Use custom Approve and Reject buttons on a workflow task configured as an Approval task. You can give each button its own label, style, and form action.
This example adds a shared comments field. Approval accepts an optional comment. Rejection requires a reason. Both actions write the field into the task comment shown in workflow history.
1 Setting Up Custom Buttons and Comments Field on the Task Form
1.1 Removing the Default Action Panel
In a test copy, open the Approval Form Designer and select the form associated with the Approval task. Check which built-in controls the process needs, such as Reassign or Add assignee. Remove the default Action Panel from the test copy when the custom controls can cover the required task actions.
1.2 Adding Custom Approve and Reject Buttons
From the controls panel, drag and drop two button controls onto the task form canvas. Label the first button "Approve" and the second button "Reject." Change the styles of those 2 buttons to make the "Approve" button as green, and the "Reject" button as red.
1.3 Adding a Custom Comments Field
Add a Multiple line control labeled Add comments. Bind it to the workflow variable field_custom_comments, named Custom comments. Leave the field optional so approval can proceed without a comment. The Reject action will require a reason.
2 Configuring Form Actions for the Custom Buttons
2.1 Opening the Form Actions Management Window
From the top-right corner of the Form Designer, click the "Actions" button to open the Form Actions Management window on the right slider window.
2.2 Creating the "Custom approve" Form Action
Click "+ New action" from the top right of the slider window to create a new form action.
To customize the action name, click the dropdown button next to the action's default name and choose "Rename action" from the list.
Change the action name to "Custom approve".
2.3 Adding a Step to the "Custom approve" Action
Next, click "+ Add a step" button. From the pop-up step types window, select "Submit form."
Choose Form Submit/Task Approve/Task Complete as the submit type. On an Approval task, this records approval.
Under Task Settings for actions triggered outside the Task Panel, open the Expression Editor next to Task Comment.
Click the "Expression" button and select "Workflow variables" from the pop-up window. Then, choose "Custom comments" from the list of variables and click "Insert" to add this variable.
Click "OK" to close the window.
By completing these steps, the content entered in the "Custom comments" field will be set as the comment for the task result when the "Approve" button is clicked.
Finally, click the "Save" button to save the settings of this Submit Form step.
2.4 Configuring the "Approve" Button
Select Approve and open Content → Action. Set Execute Type to Action, then choose Custom approve.
This will trigger the "Custom approve" action when the task owner clicks the "Approve" button.
2.5 Creating the "Custom reject" Form Action
Click the "Actions" button from the top-right of the form designer to open the Form Actions Management window. Click "+ New action" to create another form action. Rename this action to "Custom reject".
2.6 Configuring the "Custom Reject" Form Action
In the "Custom reject" action, add two steps. Firstly, use a Confirm Dialog step to check if the "Add comments" control is blank. Click the "+ Add another step" button and select "Confirm Dialog" from the pop-up window.
Set the Confirm Dialog step’s execution condition to Custom comments == [empty]. Use the confirm question to ask for a rejection reason.
Enable Continue next step when condition is not met on the dialog step. If a comment is already present, the action skips the dialog and advances to the submit step.
Add a "Submit Form" step after the "Confirm Dialog" step.
For Submit Form, set the execution condition to Custom comments != [empty], then select Reject as the submit type. The action checks this condition again if the approver clicks OK without a reason.
Set Task Comment to Workflow Variables → Custom comments and save the step.
2.7 Configuring the "Reject" Button
Select Reject and open Content → Action. Set Execute Type to Action, then choose Custom reject.
This links the "Reject" button to the "Custom reject" action, activating it when clicked.
3 Publish and Test the functions
Publish the approval form in a test application. Submit separate requests and open their pending tasks as the assigned approver.
Approve: Test with a comment and with the field blank. Verify that both tasks follow the approval route. If a comment was entered, check it in workflow history.
Reject with a blank comment: Confirm that the prompt appears. Test both OK and Cancel, and check that each leaves the task pending.
Reject with a reason: Confirm that the task follows the rejection route and the reason appears in workflow history.
Install the "Custom Approve Button" Template
Search for Custom Approve Button in the Yeeflow application template catalog. Install it in a test workspace to inspect the button bindings, submit types, and rejection condition.
With custom approve and reject buttons on the Yeeflow approval task form, you can enhance your approval workflows significantly. The ability to configure unique actions and collect custom comments adds flexibility and efficiency to the approval process. By following the steps outlined in this guide, you can seamlessly set up custom buttons and actions, leading to a more streamlined and collaborative approval experience.




