๐Ÿ”ขData input via Forms, using Roles to partition user activities

For a demo example of following steps, here is the policy timestamp: 1675164605.096601003


Construct a policy in which one group of users can individually fill in and submit documents for approval and view their own documentsโ€™ status, and another group of users can view and take approve/reject actions on any of these user documents.


  1. Assign โ€˜Userโ€™ and โ€˜Approverโ€™ roles to users to partition them into groups where one can fill in forms and send resulting documents to approvals, and the other group would โ€˜approve/rejectโ€™ these documents.

  2. Create schema and necessary policy elements to enable โ€˜form-filling in and submissionโ€™ and โ€˜approvalโ€™ workflows.


Create 3 containers which will be responsible for choosing a role, submission and approval documents correspondingly.

Assign these containers to appropriate Permissions: โ€˜no_roleโ€™, โ€˜Userโ€™, or โ€˜Approverโ€™, and add the first containers into the RoleSelectionBlock.

See detailed information about the Roles in Example 1.

Main section

Creating the document

1. Create a schema for Policy data input

1.1 Go to โ€˜Schemasโ€™ tab and create a new schema

1.2 To make sure there is some demo/test data content in this schema create 3 fields:

  • Organization name of type โ€˜Stringโ€™

  • Start Date of type โ€˜Dateโ€™

  • End Date of type โ€˜Dateโ€™

  • Amount of type โ€˜Number to represent the amount of CO2 emissions for the time period (between the โ€˜Start Dateโ€™ and โ€˜End Dateโ€™)

2. To perform data input into the Policy the โ€˜requestVcDocumentBlockโ€™ will be used

2.1 Since the scope of this example includes input of multiple documents the Policy requires logic similar to what is known as โ€˜loopโ€™ or โ€˜iterationโ€™.

For this โ€˜interfaceStepBlockโ€™ is required with โ€˜Cyclicโ€™ option enabled. This will allow to return to the initial state after the document was saved.

2.2 Add โ€˜requestVcDocumentBlockโ€™ into the โ€˜cyclic_containerโ€™

2.3 Then select the previously created Schema

2.4 Select โ€˜New UUIDโ€™ to configure automatic generation of unique IDs for each document

2.5 By default โ€˜requestVcDocumentBlockโ€™ is displayed as a Form covering the entire page. To prevent this choose โ€˜DIALOGโ€™ value for the field โ€˜Typeโ€™.

3. Save documents in the Database.

3.1 Add โ€˜sendToGuardianBlockโ€™ into the container โ€˜cyclic_containerโ€™ immediately after โ€˜create_new_documentโ€™

3.2 Select data type and where to store the document

3.3 Create appropriate attributes to capture/store document status

Add โ€˜Statusโ€™ attribute and set the initial โ€˜Newโ€™ value for new documents

Displaying the documents

  1. To display documents โ€˜interfaceDocumentsSourceBlockโ€™ is used

1.1 Add โ€™interfaceDocumentsSourceBlockโ€™ into the โ€˜user_rolesโ€™ container

1.2 Specify the needed columns, their titles and where the values will be taken for display

1.3 To retrieve the data from the database โ€™documentsSourceAddonโ€™ block is used

1.3.1 Add โ€˜documentsSourceAddonโ€™ to the โ€˜user_gridโ€™

1.3.2 Select where to retrieve the documents from

1.3.3 Select the schema upon which the selected documents should be based on

1.3.4 Select โ€˜Owned by Userโ€™ checkbox which would filter in only the documents that are created by this user (this will disable the ability to view other documents)

Approving the documents

  1. To display documents โ€˜interfaceDocumentsSourceBlockโ€™ is used

1.1 As in the previous section we added โ€˜interfaceDocumentsSourceBlockโ€™ and configured displayed columns

1.2 Add additional column which would contain the โ€˜Approveโ€™ button

1.3 Since the Approve button should be displayed only for new documents use two โ€˜documentSourceAddonโ€™ block

Configure both โ€˜documentSourceAddonโ€™ blocks similarly to how it was in the previous sections, except here do not select the โ€˜Owned by Userโ€™ checkbox to allow the Approvers to see all documents (created by all users)

1.4 Separate the documents by status by means of creating the corresponding filters

  1. To enable actions (in this example โ€˜Approveโ€™ and โ€˜Rejectโ€™) the โ€˜buttonBlockโ€™ block is used.

2.1 Best practice is to wrap the โ€˜buttonBlockโ€™ block in a container

Switch off the โ€˜Default Activeโ€™ option to avoid specifying the button as an independent element and hide it

2.2 Create 2 buttons for โ€˜Approveโ€™ and โ€˜Rejectโ€™ correspondingly.

2.3 โ€˜buttonBlockโ€™ is responsible only for the actions, in order to save the refreshed status of the documents.

Create 2 โ€˜sendToGuardianBlockโ€™ blocks with the corresponding values for the โ€˜Statusโ€™.

2.4 By default blocks are always directly connected to the next block (just below it). To decouple the blocks select โ€˜Eventsโ€™ tab and switch off the default events for both blocks.

2.5 Connect events from the โ€˜buttonBlockโ€™ with the corresponding โ€˜sendToGuardianBlockโ€™ by selecting the Events tab and create 2 new events.

  1. Return to the grid settings and add the created buttons into the previously prepared column

3.1 Set โ€˜Typeโ€™ to โ€˜BLOCKโ€™

3.2 Set โ€˜Bind Blockโ€™ to the block which we can place into the column

3.3 In order to display the buttons for only new documents set the corresponding value for the โ€˜Bind Group'


1. Choose a role

2. Create new document

3. Approve

Last updated