Build the Approve Request Screen
Key Lesson: Build a task Screen that receives Process data, reuses an existing Screen for read-only request details, and returns a decision through a Process-driving output.
Build the PurchaseRequestApprove Screen that Approvers use to review a submitted purchase request. This step builds the Screen only; the next step assigns it to the existing Approve PR User Task.
1. Create the Screen
Section titled “1. Create the Screen”- In Design, under Object Types, select Screen.
- Select +.
- Enter
PurchaseRequestApproveas the Screen ID, then select OK. - Select the default Text component and set Text to
Please approve or reject the following request:. -
Leave all other properties at their default values.
-
Save your changes before continuing.
2. Define the request input
Section titled “2. Define the request input”The request input receives the submitted PurchaseRequest from the Process when the task opens.
- Open the Screen’s Variables tab.
- Select + Add new variable.
- Configure the variable as follows:
| Property | Value |
|---|---|
| Name | request |
| Context | Input |
| Type | |
| Default expression | (Leave blank) |
-
Save your changes before continuing.
3. Embed PurchaseRequestInclude
Section titled “3. Embed PurchaseRequestInclude”Reuse the PurchaseRequestInclude Screen so the approval Screen displays the same request fields and line items as the Create Screen.
- Return to the Layout tab.
- From the SCREEN STRUCTURE section of the Components toolbar, drag a Screen component into the main content area below the Text component.
Editor Help
- Configure the embedded Screen as follows:
| Tab | Property | Value |
|---|---|---|
| Properties | Screen | Purchasing.PurchaseRequestInclude |
| Inputs | request | |
-
Leave all other properties at their default values.
-
Save your changes before continuing.
4. Make the request details read-only
Section titled “4. Make the request details read-only”Wrap only the embedded PurchaseRequestInclude Screen in a Disable component. The comment and decision controls added afterward must remain enabled.
- Select the embedded
PurchaseRequestIncludeScreen component. - From the LOGIC section of the Components toolbar, add a Disable component next to it.
- Drag the embedded Screen inside the Disable component.
- Configure the Disable component as follows:
| Property | Value |
|---|---|
| Disabled | true |
| Keep disabled if already disabled | Checked |
-
Leave all other properties at their default values.
-
Save your changes before continuing.
5. Add the Approver comment
Section titled “5. Add the Approver comment”- In the VARIABLES panel, expand
screen.requestand confirm thatcommentis available. - From the CORE section of the Components toolbar, add an Input below the Disable component.
- Configure the Input as follows:
| Property | Value |
|---|---|
| Label | Approver comment |
| Binding | |
| Type | Text Area |
-
Leave all other properties at their default values.
-
Save your changes before continuing.
6. Define the Process-driving output
Section titled “6. Define the Process-driving output”Create the submit output used by the Approve and Reject controls. The decision and comment are passed to the Approve PR task’s output handler after the Screen is connected in the next step.
- Open the Screen’s Outputs tab.
- Create a new output variable.
- Configure the output as follows:
| Property | Value |
|---|---|
| Name | submit |
| Output type | |
| Can drive Process forward | Checked |
-
Save your changes before continuing.
7. Add the Approve and Reject actions
Section titled “7. Add the Approve and Reject actions”- Return to the Layout tab.
- Add a Layout below the comment Input and set Layout to horizontal in one row.
- Add two Button components inside the horizontal Layout.
- Configure the buttons as follows:
| Button | Tab | Property | Value |
|---|---|---|---|
| Approve | Properties | Prefix icon | thumb_up |
| Properties | Text | Approve | |
| Appearance | Color | Primary | |
| Events → Click | Action type → Ad-hoc action | | |
| Reject | Properties | Prefix icon | thumb_down_alt |
| Properties | Text | Reject | |
| Appearance | Color | Warn | |
| Events → Click | Action type → Ad-hoc action | |
-
Leave all other properties at their default values.
-
Save and close the editor.
Outcome
PurchaseRequestApprove can display a Process-supplied request without allowing its request fields to be edited. Its comment and decision controls remain enabled and submit the documented decision object.