Blueprint Attributes
Table of Contents
Overview
Blueprint attributes are used to get details of the blueprint, such as the name, current stage, and status associated with the specified record in a report.
Blueprint Attributes
The table below lists the blueprint attributes and the values returned by them.
Attributes | Return Type | Returns |
---|---|---|
input.Blueprint.Name | TEXT | Display name of the blueprint associated with the specified record. |
input.Blueprint.Current_Stage | TEXT | Present stage of the blueprint in the specified record. |
input.Blueprint.Status | TEXT | Status of the blueprint (Active/ Completed/ Suspended) in the specified record. |
Note:
- Blueprint attributes are applicable for all workflow events.
You can use blueprint attributes in fetched collection variable with the fetch records task. Refer to the syntax below.
<collection_variable> = <form_link_name>[<criteria>].Blueprint.<attribute>;
Blueprint attributes can be used as criteria in conditional statements and in fetching records. Refer to the syntax below.
<collection_variable> = <form_link_name>[Blueprint.Current_Stage <operator> <expression>];
Example 1: Fetch the active blueprint records and update
The following example fetches the status of the blueprint associated with the specified record in a report and updates the specified field.
variable = task[ID != 0]; //fetch the status blueprint in all records. for each record in variable //Update the due date, if the blueprint is active in the record { if (record.Blueprint.Status = "Active") { dueDate = '10-Mar-2023'; } }
Example 2: Fetch records with specific blueprint name and change their stage
The following example fetches the name of the blueprint associated with the specified record in a report and changes its blueprint stage.
// Fetch the specified record variable = client[Blueprint.Name = "New_client"]; for each record in variable { updateStatus = thisapp.blueprint.changeStage("client", "New_client", "Pending", record.ID); }
Example 3: Fetch records with specific blueprint stage and perform the transition
The following example fetches the records with the specified blueprint stage and executes the specified transition.
variable = orders[Blueprint.Currentstage = "Out for delivery"]; for each order in variable { performTransition = thisapp.blueprint.executeTransition("orders", "delivery process","update delivery date", orders.ID); }
Use Case Scenario
Let's take an order management application with the orders form associated with the blueprint order_status. Consider a scenario where the user wants to display the count of orders delivered on that day, given the condition that if the blueprint reaches the final delivered stage, the delivery date will be automatically recorded in a delivered_date field in the orders form. The below-mentioned code counts the records in the delivered stage of the blueprint. You can populate this number in the desired place in your application, like panels in pages.
orders_delivered = orders[delivered_date == zoho.currentdate && Blueprint.Current_Stage == "delivered"].count();