I have ‘Tags’ (table) with ‘Name’ (text column) and ‘Parent’ (relation column to 'Tags:Name, single selection) and an ‘Objects’ (table) with ‘Name’ (text column), ‘Object Tags’ (relation column to ‘Tags:Name’, multiple selection), and ‘All Tags’ (!formula).
I am trying to build a formula in ‘Objects:All Tags’ that will take all of the values from ‘Object:Tags’ in the same row, then lookup the values of the ‘Tags:All Parents’ for each, then return all of the unique ‘Object:Tags’ and ‘Tags:All Parents’.
I’m so close!
Object Tags (table)
- Name: text
- Parent: relation: ‘Object Tags:Name’, single selection
- All Parents: formula, working, good:
WithName(
thisRow.Parent, parentCategory,
If(
parentCategory.IsBlank(),
List(),
WithName(
parentCategory.[All Parents], accumulatedParents,
ListCombine(accumulatedParents, parentCategory)
)
)
)
Objects (table)
- Name: text
- Tags: relation: ‘Object Tags:Name’, multiple selections
- All Tags: ! formula: not working as desired:
WithName(
thisRow.Tags, selectedTypes,
selectedTypes.FormulaMap(
ListCombine(CurrentValue.[All Parents], CurrentValue)
).Unique().FormulaMap(CurrentValue)
)
However, in the UI, the above formula returns two complete (not unique) sets of values, as well as brackets for the sets.:
The CSV raw data is:
Name,Tags,All Tags,Relationships
McDonald’s,"Fast Food,Chain Restaurant","Place,Business,Restaurant,Fast Food,Place,Business,Restaurant,Chain Restaurant"
Desired Result:
With the following ‘Object Tags’ (table)
Name | Parent | All Parents |
---|---|---|
Place | ||
Business | Place | Business, Place |
Restaurant | Business | Restaurant, Business, Place |
Fast Food | Restaurant | Fast Food, Restaurant, Business, Place |
Chain Restaurant | Restaurant | Chain Restaurant, Restaurant, Business, Place |
In 'Objects (table), the desired result for ‘All Tags’ would be:
Object | Tags | All Tags |
---|---|---|
McDonald’s | Fast Food, Chain Restaurant | Fast Food, Chain Restaurant, Restaurant, Business, Place |
Any help or guidance would be appreciated. What can I do to return the desired result?