Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Unique values shown as a list

Posted on by 121

I have a staff log where each staff member updates regularly.

 

I'm trying to create a way of seeing how long it has been since each person updated it.

 

I need a list which shows the unique value based on the staff member which is filtered to show the most recent entry.

 

It can't be in a drop down but all visible at the same time.

 

The staff field is the standard created by from sharepoint and the date is saved as RecordDate.

 

Thanks in advance

Categories:
  • Ami K Profile Picture
    Ami K 15,656 on at
    Re: Unique values shown as a list

    Hi @Markswan20 ,

     

    GroupBy is not supported on complex field types. Use AddColumns to store the complex field attribute (in this case, the Display Name) as a new "virtual" column.

     

    ForAll(
     GroupBy(
     AddColumns(
     Command,
     "CreatedDisplayName",
     'Created By'.DisplayName
     ),
     "CreatedDisplayName",
     "_items"
     ),
     First(
     Sort(
     _items,
     RecordDate,
     SortOrder.Descending
     )
     )
    )

     

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

    Imran-Ami Khan

     

     

  • Markswan20 Profile Picture
    Markswan20 121 on at
    Re: Unique values shown as a list

    I've hit a snag, i want the filter to utilise the default field ThisItem.'Created By'.DisplayName

    I have imported this into the galley but the coding kicks up error.

     

    This is the current code

     

    ForAll(GroupBy(Command,"'Created By'.DisplayName","_items"),First(Sort(_items, RecordDate, SortOrder.Descending)))

  • Markswan20 Profile Picture
    Markswan20 121 on at
    Re: Unique values shown as a list

    Thank you Amik

  • Verified answer
    Ami K Profile Picture
    Ami K 15,656 on at
    Re: Unique values shown as a list

    @Markswan20 - as I understand it, I think you're trying to create a table of unique values amongst duplicates by the most recent date. Another way to phrase it is that you want to display the latest records in a Gallery amongst duplicates.

    If that is correct, you can try applying the below expression in the Items property of a Gallery:

     

    ForAll(
     GroupBy(
     'Your Data',
     "The field which contains duplicates",
     "_items"
     ),
     First(
     Sort(
     _items,
     Modified,
     SortOrder.Descending
     )
     )
    )

     

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

    Imran-Ami Khan

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,246

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,884

Leaderboard