If you have created a custom work order field, you then need to create a Salesforce Flow, which at run-time will dynamically allocate the Axsy Smart Form assigned to the work order.
In order to specify which Smart Form should be assigned to a particular Work Order, you will need to first create a custom work order field to reference the Smart Form that you would like to associate. The above steps are covered in the following support guide article: How to deploy a Smart Form using a Salesforce Flow Custom Work Order Field
Setup the Flow on the Salesforce Platform
1. From Salesforce Setup, use the Quick Find search and type in Flows.
2. Under Process Automation select Flows.
3. Select New Flow.
4. From the menu options, select Field Service Mobile Flow and then Create.
Create New Resources
To create the new resources from the toolbox, select the Manager tab and then the New Resource Button. Create the following New Resources:
1. A text variable with the value of Id.
Field | Value |
API Name | Id |
Data Type | Text |
Available for input | Selected |
Available for output | Selected |
Field | Value |
API Name | FormId |
Data Type | Text |
3. A record variable with the value of CurrentWorkOrder.
Field | Value |
API Name | CurrentWorkOrder |
Data Type | Record |
Object | Work Order |
Once these New Resources are created you can then create the Salesforce Flow.
Configure the Flow
1. From the Elements tab under the toolbox, drag and drop Get Records onto the page.
2. When the window opens, enter these values for the Get Records request:
Field | Value |
Label | WorkOrder |
API Name | Will already be populated |
Object | Work Order |
Condition Requirements | Conditions are met |
Field | Search for and select Work Order Id: Id |
Operator | Equals |
Value | Search for and select {!id} |
3. Scroll down the page and complete the rest of the Get Records request:
Field | Value |
How many Records to Store | Only the first record |
Where to Store Field Values | Together in a record variable |
Record Variable | Search for and select {!CurrentWorkOrder} |
1st Field | ID |
2nd Field | Name of the Custom Lookup Field created to lookup a Smart.Form |
4. Click Done.
5. Next, drag and drop an Assignment onto the main page (under the Elements tab of the toolbox). Complete as follows:
Field | Value |
Label | Set to a recognisable value |
API Name | Will be automatically populated |
6. In the Set Variable Values section of the Assignment, set the following:
Field | Value |
Variable | Set to {!FormId} |
Operator | Equals |
Value | Search for and select {!CurrentWorkOrder.name} (where name is the Custom Lookup Field for the Work Order) |
7. Click Done.
8. Drag and drop an Action onto the main screen (under the Elements tab of the Toolbox). When the Action opens, using Filter By, select Type and then select Apex Action (Legacy) as the action.
9. In the corresponding box to the right, search for and select Mobile Smart Form axsy_forms_FlowFormRunner as the Legacy Apex action. Then click Done.
10. Double click on the Apex Action (Legacy) process flow to assign it a value. Give the Apex Action (Legacy) process flow values as follows:
Field | Value |
Label | Set to a recognisable value |
API Name | Will be automatically populated |
Description | Optional |
Set Input Values | {!FormID} |
12. Select Back and return to the Salesforce Flow page summary to Save the Salesforce Flow.
13. Select the new Salesforce Flow and Activate it.
Now you have successfully configured your Salesforce Flow, you can now link it to an app extension that will make the Smart Form available in the Axsy app via the Quick Action Menu. Please see this article for more information: How to make Smart Forms visible in Axsy Mobile Apps – App Extensions