Dynamic values on a Calculated Sublist Field using Actions Builder
I have an issue with Sublists and dynamic calculated Fields.
My main problem is that when I update the title of a list [Company] item, it is not updated on the subList [Adress], which has a Calculated Field value that includes the Title of the main List [Company].
To solve this, I use an update List Item Action when I click save on the edit form of the main list [Company]
The problem now is that a [Company] can have multiple [Adresses], and if I use this approach, every address will be updated with like below.
To solve that, I tried to go through using a Foreach or While loop in the List item ID or Calculated value field. Like that i hoped to only write one array value per time, but both approaches did not show a positive result.
Now, I'm not sure if I have an error in my code or my approach is not realizable. Any ideas or suggestions on this matter would be welcome.
Hi Andreas Teixeira
Your approach will not work because: with [[@Sublist.Addresses. ...]] placeholders you will get back always all related adresses. but this is anyway not the way to build that case.
In your structure of the masterlist "Companies" and the sublist "Adressen" you can react on changes of the masterlist values that are used for calculations in your sublist by Metadata Inheritance.
1. Create a column "CompanyName" on your "Adressen" list and configure an "Inherit" calculation for the company's Title column in "Things in background". Result: Every address item will get it's parents company title in this column and this will get updated when it changes on parent list.
2. Now you can use this calculated column "Company Name" to calculate your title of "Adresse" item. As well as field calculation in "Things in background"
This configuration will keep always the titles of all your "Adresse" items up-to-date when the "Company" name will change.
Since this calculations are automatically done "in the background" it takes some seconds until it changed on each item. Probably you want to calculate it as well on the forms when users are working with it and want see the calculated title immediately. Therefore add the same title calculation on the new- and editform of the "Adresse" list:1
Great explanation Christof!
It worked perfectly as you have described. Thanks for the help, its very much appreciated.
Please sign in to leave a comment.