You have been creating some amazing and complex apps using different controls even across multiple forms. However, you may have seen that the responses have been delayed and the overall app seems to be taking longer than expected. This is because you would have some dependent controls which get evaluated several times causing the delays.
Dependent controls are the controls that use other controls in their formula. There would be scenarios where you might use a LOOKUP or a BINDAPI call from some screen that refers to one of the controls from another screen. Now every time you make any change to the value of control of the first screen, these calls from the LOOKUP or BINDAPIs even from other forms would also be evaluated every time.
Now to avoid this evaluation of the dependent control across multiple forms, you can disable the Trigger Dependents property of the control on the first screen/parent screen. So every time there is a change in the value of the parent/ first screen, the dependent controls would not be evaluated. This helps in limiting the evaluation and thus optimizing operations when you have complex apps. By default, the Trigger Dependents property is Enabled. You need to switch it OFF from the parent screen control from where it is being referenced in the dependent control on other forms.
Let us take an example to understand. We would be using the Product type from one screen (for example, Triggerdependent screen) in another screen to fetch the discount percentage depending upon the type of product from a sheet.
So let us add the ProductID, Product Name, Product Type, Quantity, Price, and TotalAmount fields on the first screen. So here we would insert data into a sheet using the Submit button for the respective Product ID. There is another option to apply a discount and then submit data.
To apply the discount for the same product we will add another Screen (in this example here - trigger dependent child).
Here on the other screen, the discount will be fetched from the sheet using the LOOKUP() but based on the product type entered on the first screen.
Now by default when you run the first form, and you enter Product Type, the discount control which is using this control in the LOOKUP formula in the second screen also gets evaluated even though that screen is not visible yet. Now when you click on the Apply Discount button and navigate to the second screen all controls in that screen get evaluated again, so in that case, discount control which is using LOOKUP formula gets evaluated again.
So here we can see the LOOKUP of the second screen is called 2 times even though it could be optimized to call only once. To optimize this, we will turn OFF Trigger Dependents property of Product type control on the parent screen so that whenever that control changes it doesn’t call the LOOKUP formula applied on discount control which will evaluate only once when that screen is navigated to.
Thus by using the Trigger Dependent property you can ensure that there is no unnecessary evaluation of the dependent controls which can have a substantial effect on the speed when you are creating complex apps.