very happy with your stuff. I have one specific thing for UX of my app I'd like to ask for help with the idea;
How would you approach;
Approve/Reject button with Comment, If Reject, comment mandatory - with Flow/Power Automate Approval running on the item on Plumsail Form.
Scenario;
Main item is created
Flow is run on main item which creates multiple new Approval items in the custom list
The list has Flow on new item created and starts Flow Approval Action
User can approve from Flow, E-mail - how to let the user to approve from the item?
Any recommendations? I didn't seem to find any similar post in the community but please feel free to link me to right topic.
You can add to buttons, Approve and Reject, to the form and add the script to the Settings >> OnClick.
So that when Approve/Reject button is clicked, the status of the item changed to approved/rejected and saved the item. For Approve button the script will be the following:
fd.field('Status').value = 'approved';
fd.save();
And to make Comment field required when the item is rejected you need to add custom validator. Please use the following code in JavaScript Editor.
fd.spRendered(function() {
fd.validators.push({
name: 'CommentFieldValidation',
error: "Comment field is required",
validate: function(value) {
if (fd.field('Status').value == '12345' && fd.field('Comment').value == '') {
return false;
}
return true;
}
});
});
is there a way to check the validation in button click instead of presave. i need some button just to save as draft without checking validation and some button check if field is null. Thank you
there is one but where setting field on button click is not working in ie explorer most of our user have ie explorer is it known issue? if so is there a workaround for that? Thank you.
Well, I mean that your solution seems to set a field to approved or rejected, but doesn't necessarily mention the Approval flow that is mentioned in the original question.
Main item is created 2. Flow is run on main item which creates multiple new Approval items in the custom list
The list has Flow on new item created and starts Flow Approval Action
User can approve from Flow, E-mail - how to let the user to approve from the item?
So while the the button sets the status and saves the form, it doesn't necessarily complete the Approval Flow automation correct?
If we are talking about SharePoint Online and 'Start and wait for an approval' action in Power Automate (MS Flow), then the approval buttons are available only in the email notification, and they are not integrated into default Sharepoint forms and Plumsail Forms.