Knowing how and when to run historic or new expressions when building apps is a very useful tool when looking to maintain the most accurate and up-to-date Records possible.
When to Re-Run Expressions: 3 Scenarios
1. Standard Expression
- If you have changed a pre-existing Expression.
- If you have created a new expression, this could be in a pre-existing Field or a new expression in a newly created Field.
2. Parent Expression (In Child Apps)
- If you have changed a pre-existing Parent Expression.
- If you have created a new Parent Expression, this could be in a pre-existing Field or a new Parent Expression in a newly created Field.
3. Child Expression (In Parent Apps)
- If you have changed a pre-existing Child Expression.
- If you have created a new Parent Expression, this could be in a pre-existing Field or a new Child Expression in a newly created Field.
How to Re-Run Expressions: Large vs. Small-Scale
1.) Standard Expressions - A change to one of its Dependent Fields is required in order for the Expression to update the Field's value.
2,3.) Parent & Child Expressions - A change made anywhere within either the Child Record (for Parent Expressions) or Parent Record (for Child Expressions) is required in order for the Expression to update the Field's value.
Large Scale
In cases where you need to run or re-run Expressions across a larger number of Records it is far more time-effective to achieve this via an Export and Import. For any type of expression above this can be done with a simple 'Update' Bit Field - the exact method varies slightly however...
Creating an Update Bit
Once this field is created you can hide it from general view by not putting it in any Templates, it will still be a stored Field against any Record, one that can be edited from an Export and used as described below.
1.) Standard Expressions - Put an 'if' condition containing the 'Update' Bit in front of the new or changed expression for example: if([Update] = true, new/updated expression, ''). You should put value of true or false for [Update] depending on whether its current value is true or false, if true than put false in the if condition and vice versa.
Once you export the records you wish to trigger the Expression in, you should change the [Update] value in the .csv file to the opposite of what it currently is. In .csv format true and false need to be typed in capitals. Then upon re-importing you should find the expression changes have ran. You then need to update the expression back to the original otherwise it won't trigger in the future
Tip - Always keep a copy of the original Export, this can be used to re-import and revert back to before if when making any changes the data is accidentally mis-managed.
2.) Parent & Child Expressions - Simply follow steps outline for 1.) Standard Expressions without the need for an if condition. This is because only any change to a Record is needed, and not one specific to a Dependent Field for these type of Expression changes to run.
Small Scale
If you're working with a very limited number of records in an App then you can trigger the Expressions in each individual Record by meeting the Standard or Parent & Child Expressions criteria above. Editing Fields directly on a Table Report is another way to achieve this, or you can make use of the In-Line Edit Feature of a List Report to again trigger Expression runs and re-runs.
^In-Line Edit (List)^
^Table Report^
Comments
0 comments
Please sign in to leave a comment.