Assign a value to a field of workflow task

Let’s consider the example in which a value is assigned to a field of a workflow task depending on a value of another field of the same workflow task. For example, you might need to show the remaining time until the deadline, when your workflow task is in particular status. The remaining time should be calculated as the difference between the due date and the current server date. And then the calculated value should be assigned to the specified field.

For this example the IF, OR and SUBTRACT functions should be used.

To configure the rule:

1. Select a workspace, select an application.

2. Click Fields.

3. Create the Due Date (ID: Due_Date) field of the Date/Time type.

4. Create the Remaining Time field of the Duration type. This field will display the remaining time until the deadline, depending on the status of the workflow task.

Go to the attributes of the Remaining Time field and select the Calculated check box. The Field Expression tab becomes available.

5. Obtain the identifiers of required fields and workflow statuses. For example:

  • workflowState - the identifier of the workflow task system field, which represents the current status of the workflow task.
  • wfstate.approvedImplementation, wfstate.ReviewbyManager - the identifiers of the workflow statuses Implementation and Review. You can replace them with identifiers of your custom workflow statuses.

6. Type the following expression into the built-in editor:

 

IF

(

OR

(

$workflowState == ID(""wfstate.approvedImplementation""), $workflowState == ID(""wfstate.ReviewbyManager"")

),

SUBTRACT($Due_Date, $$now),

DURATION(""PT600S"")

)

7. Click Save&Close.

8. Go to Form and drag the created fields to the workflow task form. Save the changes.

To check how the created rule works, create a new workflow task and move it through workflow. When the workflow task will be in Implementation or Review status, the Remaining Time field will display the difference between the due date and the current server date. Otherwise, the constant value will be assigned to the field (10 minutes in our example) in order to verify the functionality of our expression.

Attachments
There are no attachments for this article.
Feedback
Security Code
Related Articles
Navigation
Viewed 44 times since Wed, May 20, 2020

Navigation pane
Viewed 47 times since Wed, Dec 5, 2018

About The Dashboard
Viewed 81 times since Wed, Dec 5, 2018

Set the task priority based on the parent workflow task/doc priority
Viewed 49 times since Wed, Dec 5, 2018

Managing parallel subtasks and subprocesses in Comindware Tracker
Viewed 41 times since Wed, Dec 5, 2018

Creating a Microsoft Installer (MSI) Log of Comindware Products
Viewed 48 times since Wed, Dec 5, 2018

Configuring Mozilla Firefox
Viewed 41 times since Wed, Dec 5, 2018

Adding Existing Applications In a Workspace
Viewed 46 times since Wed, Apr 8, 2020

Configuring Integration Settings in Microsoft SharePoint
Viewed 76 times since Wed, Dec 5, 2018

Workspaces, Applications
Viewed 42 times since Wed, Dec 5, 2018