This article covers two major budgetary use cases for replacing existing form objects with an expression field. The same concepts can be applied to other use cases and object types as well.
- Case #1: Number object type being replaced with an expression field
- Case #2: Number object type with an expression in the value attribute being replaced with an expression field
Case 1
Existing form set up:
- Three number fields are added to the Summary Budget section.
- No expressions are defined, so each field must be manually populated.
- All fields can be included in the dashboard or in-app reports.
Sample existing record:
The values are all manually entered and function independently.
Ideally, the Total Sponsor Costs field should automatically display the sum of the Sponsor Direct Costs and Sponsor Indirect Costs fields.
In this case, the Total Sponsor Costs field can be updated to use an expression field object type instead of a number field by following these steps:
- Select the desired object, and record its current ID, Short Label / Please specify Short Label, and Value attributes
- Next, select the wrench icon.
- Hover over Selection, then choose Expression Field from the submenu.
- The updated object's attributes will be displayed.
- For the dashboard and in-app reporting to recognize this as the same object, the ID and Short Label values must remain the same. When you change the object type, the ID will update by default—so be sure to replace it with the original value you recorded in Step 1.
- Enter the desired expression in the Expression attribute.
- The Value attribute is used by Report Connector as the unique identifier. To ensure the expression field object is treated as the original number field, make sure to retain the Value attribute.
- Save the draft form, then use Preview mode to test the expression field object. Once validated, publish the form.
After the form changes are published, all new records will use the updated expression field object type.
Sample record:
Notice that the field is now disabled for manual entry and automatically displays the sum of the two source fields.
Because the ID and Short Label attributes were retained, the dashboard continues to display Total Sponsor Costs values in the same column previously used by the number field.
The same behavior applies to in-app report columns. Total Sponsor Costs continues to appear in the same column as before.
Case 2
Sample form set up:
In Period1 Total Costs, the Value attribute is set as an expression that sums the first two number fields.
Sample record example:
Sample dashboard example:
Previously, Period 1 Total Costs used an expression in the Value attribute, so it wasn’t stored as a separate field in the record and couldn’t be added to the dashboard.
Now, Period 1 Total Costs can be converted to an expression field using the same steps as Case 1, making it independently reportable.
The only difference from Case 1 is that the expression originally in the Value attribute should be copied into the Expression attribute. Then, update the Value attribute so it no longer contains the expression. This change will cause Report Connector to treat it as a new field; however, as long as the ID and Short Label attributes are retained, the SP dashboard and in-app reports will still recognize it as the same object.
Once the change is published, new records will appear the same in the record UI, but the Period 1 Total Costs columns in the dashboard and in-app reports will now populate correctly.