web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Nested JSON - Get Dist...
Power Apps
Unanswered

Nested JSON - Get Distinct "tags" by id

(0) ShareShare
ReportReport
Posted on by

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.

bpplls_0-1658725685333.png

 

Sample code in the dropdown Items property.

bpplls_1-1658725793331.png

 

How can I display the values of these two Result?

Thanks in advance.

 

 

 

 

 

Categories:
I have the same question (0)
  • shoog Profile Picture
    2,164 on at

    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

     

  • Verified answer
    iAm_ManCat Profile Picture
    18,228 Most Valuable Professional on at

    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,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard