Hi All,
I have a JSON file and I want to get the Distinct "tags" of the user ID and display it on the Items property of the dropdown.
"tags" is in an array format.
Sample JSON generated from getting the ID of the user.
Sample code in the dropdown Items property.
How can I display the values of these two Result?
Thanks in advance.
Solved! Go to Solution.
Heya,
To account for any number of potential tags per item you have to get a bit wizardy:
With(
{
ConcatText:
//Get a text string containing all tag items
Concat(
ForAll(
projed,
Concat(
ThisRecord.Value.tags,
Value & ";"
)
),
Value
)
},
Distinct(
//Split the text string into items which then can be made distinct
Split(
//Don't include last ; so that no blank items
Left(
ConcatText,
Len(ConcatText) - 1
),
";"
),
Result
)
)
Included a POC App here for you to download - might be worth playing around with that to see if it will help 🙂
Cheers,
@iAm_ManCat |
Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you! |
Thanks! |
Is it possible the JSON includes two id's or will it always be one?
If it's always just one, you could use
Distinct(First(collIt2).tags,Value).Result
Heya,
To account for any number of potential tags per item you have to get a bit wizardy:
With(
{
ConcatText:
//Get a text string containing all tag items
Concat(
ForAll(
projed,
Concat(
ThisRecord.Value.tags,
Value & ";"
)
),
Value
)
},
Distinct(
//Split the text string into items which then can be made distinct
Split(
//Don't include last ; so that no blank items
Left(
ConcatText,
Len(ConcatText) - 1
),
";"
),
Result
)
)
Included a POC App here for you to download - might be worth playing around with that to see if it will help 🙂
Cheers,
@iAm_ManCat |
Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you! |
Thanks! |