Using Subform Data to Update or Create Subform Data
Introduction
Functions
When you update the subfield in a SubForm, you can update or create data in another form's SubForm by triggering Automations:
- If the data of another form's subform satisfies the filter conditions, Automations would update it.
- If the data of another form's subform does not satisfy the filter conditions, Automations would create new data.
Application Scenarios
In refund management, there is an order form and a refund follow-up form. After approving the order form, a record in the refund follow-up form will be created by Automations automatically. If the data in the order form is updated or created, the refund follow-up form will be automatically updated by Automations.
Preview
1. If you add one record whose order number is JDY–0002 in Order Form, one record will be created synchronously in Refund Follow–up Form:
If the form data does not meet the conditions, no matter whether the subform meets, one record will be created in the triggered form.
2. If you update the data of JDY–0001 in the Order Form, the data will be updated synchronously in the Refund Follow-up Form:
If the form and the subform both meet the conditions, the data will be updated in the corresponding rows of the subform in the triggered form.
3. If you create one record in JDY-0001 in the order form, one new record will be created simultaneously in the subform of the Refund Follow-up Form:
If the Order Form satisfies the condition while the subform does not, a subrecord will be created in the corresponding subform of the triggered form.
Setting Procedure
Take the refund project management as an example.
Creating a Form
1. You can create a workflow form which is titled Order Form, and create a subform which is titled Order Detail.
Field Name | Field Type |
Order Number | Single Line |
Customer Name | Single Line |
Latest Delivery Date | Date&Time |
Order Detail | SubForm, where Product Name is set as Single Line, and Amount, Unit Price, and Price as Number. |
Sum | Number |
Approval Result | Single Select |
2. The workflow can be set in Workflow, including the approver of each node and Field Permissions. For details, see Configuring a Workflow.
- Configure Field Permissions at the initiator node.
- Choose Approver and configure Field Permissions at the approval node.
3. You also need to create a form which is titled as Refund Follow-up Form and add a SubForm which is titled as Refund Detail.
Field Name | Field Type |
Order Number | Single Line |
Customer Name | Single Line |
Latest Delivery Date | Date&Time |
Order Detail | SubForm, where Product Name is set as Single Line, and Amount, Unit Price, and Refund Price as Number. |
Sum | Number |
Setting Automations
1. Selecting a trigger
Create a Automation and name it.
Since Order Form is a workflow form, Automations will be triggered only when Approval Result is chosen as Approve. You can select Update Record in Configure Trigger, choose Order Form in Triggering Form, set Approval Result equals Approve in Add Condition. After all settings are complete, click Complete.
2. Selecting a triggered action
When an order is created in Order Form, a refund follow-up record will be automatically added in Refund Follow-up Form according to Order Number.
When a subform is updated in Order Form, a subform record will be updated in Refund Follow-up Form according to Order Number.
So you can choose Refund Follow-up Form in Triggering Form.
- Add filter conditions
You can add conditions to determine which record will be updated or created.
You need to set Form equals Form and SubForm equals SubForm in Add Condition at the same time.
Form | SubForm | Result |
Meet the condition | Meet the condition | Data of the corresponding row in the subform in the triggered form will be updated. |
Meet the condition | Fail to meet the condition | A record will be created in in the subform in the triggered form. |
Fail to meet the condition | Meet the condition | A record will be created in the triggered form. |
Note: For special circumstances, see Special Circumstances.
- Add fields
Change the records in Refund Follow-up Form to the relevant record of Order Detail in Order Form.
Notes
- You cannot delete subform data through deleting other subform data. It means even when the data in a subform is deleted, the data in another subform will not be deleted synchronously.
- For details of Automations assignment rules, see Subform Assignment Rules.