I am trying to extract distinct values from a dataset for a particular attribute.
Input:
[
{“id”:“1”, “cat_manufacturer”: “abc”, “cat_software”: “mysoftware1”},
{“id”:“2”, “cat_manufacturer”: “efg”, “cat_software”: “mysoftware2”},
{“id”:“3”, “cat_manufacturer”: “abc”, “cat_software”: “mysoftware3”},
{“id”:“4”, “cat_manufacturer”: “efg”, “cat_software”: “mysoftware4”},
{“id”:“5”, “cat_manufacturer”: “abc”, “cat_software”: “mysoftware5”},
{“id”:“6”, “cat_manufacturer”: “xyz”, “cat_software”: “mysoftware6”},
]
Result:
[
{“cat_manufacturer”: “abc”},
{“cat_manufacturer”: “efg”},
{“cat_manufacturer”: “xyz”}
]
Method 1:
I use a list item and repeat it with formula:
MAP(UNIQUE_BY_KEY(data.myDataListOfObjects, “cat_manufacturer”), {value:item.cat_manufacturer})
and set the primary label as “value”. It works !!
Method 2:
I apply same formula to set a page variable. And then try to repeat the list item with page variable and set primary label as current.value.
The first method works but the second method does not work. Can anybody explain why?
Also, I need to change the list item properties on search event which I can’t do if I use method 1 to repeat formula for list item.
Thank you.