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 / Displaying distinct it...
Power Apps
Unanswered

Displaying distinct items from a JSON object array based on one field of the object

(0) ShareShare
ReportReport
Posted on by 32

Here's a simplified version of a JSON array which I am getting back from a Jira REST endpoint. I store the issues in a PowerApps collection called jiraRawData.

"issues":[
 {
 "id":"1",
 "assignee":null
 },
 {
 "id":"2",
 "assignee":{
 "displayName":"john"
 }
 },
 {
 "id":"3",
 "assignee":{
 "displayName":"john"
 }
 },
 {
 "id":"4",
 "assignee":{
 "displayName":"mary"
 }
 }
]

 I want to display issues in a Gallery component and I can do that no problem.

However what I would like to do is to display the unique assignee names only so for the input above I would just like to see the following in my gallery

 

john

mary

 

  • I have tried assigning the Items property of the gallery component to  Distinct(jiraRawData, "assignee") but it doesn't work. I've tried so many things and I'm out of ideas.

 

  • I'm also having issues displaying the assignee in a gallery even when I just supply jiraRawData as the Items property I get the following error  Invalid use of '.'  when using ThisItem.fields.assignee.displayName as the Text attribute.

 

 

 Any help greatly appreciated.

Categories:
I have the same question (0)
  • rubin_boer Profile Picture
    4,841 Super User 2024 Season 1 on at

    hi @slong can you perhaps add some screen shots

    I created Collection _Jira and found this

    rubin_boer_0-1611857074535.png

     

    The the distinct function Distinct(_Jira,assignee)

    rubin_boer_1-1611857143981.png

     

     

     
  • slong Profile Picture
    32 on at

    @rubin_boer I've tried what you've suggested above. Still having an issue. Screenshots below as requested. I load my Collection using the following line 

    ClearCollect(jiraRawData, JIRACloud.GetIssuesForJQL("project = MYPROJECT AND issuetype in (standardIssueTypes(), subTaskIssueTypes(), Bug, Epic, Spike, Story, Task, Bug-Subtask, Sub-task) AND status in (Blocked,"&Char(34)&"In Progress"&Char(34)&", Open) AND fixVersion = 11.0.0 ORDER BY created DESC").issues);

     

    Collection.jpgDistinct.jpgText.jpg

  • slong Profile Picture
    32 on at

    I think my issue seems to be that I can't do this. How would I get around this seeing as displayName only exists within assignee sometimes. Otherwise assignee is null.

     

     

     

     

    Distinct(jiraRawData, assignee.displayName)

     

     

     

     

    Error.png

  • ManiLive Profile Picture
    41 on at

    You may want to filter the data to get the non-null ones, before using Distinct to get the unique list of displayName values.

    Distinct(Filter(Issues, !IsBlank(assignee)), assignee.displayName)

     

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard