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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Updating all records w...
Power Apps
Answered

Updating all records where people field doesn't match

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

So I have a gallery (GalleryHome) which is filtered to display records from the data source (Records) and created by the logged in user.

All the records have a Supervisor column which is a multi-select people column.

I am assuming that the Supervisor field of the last record in this gallery is the most up-to-date one and want to update all other records where there isn't a match at the click of a button.

So even if the last supervisor field is 'Person A', 'Person B' and there is another record which is 'Person B', 'Person A', that second record should still be identified as not a match and be updated.

 

I guess I can use a ForAll and UpdateIf for the update, but the problem is comparing the columns when they are considered tables. I've tried creating both a variable and a collection using Last(GalleryHome.AllItems.AcademicSupervisor) but the problem remains of creating a condition where they can be compared or records filtered.

 

Any ideas please?

Categories:
I have the same question (0)
  • BCLS776 Profile Picture
    8,994 Moderator on at

    Try this Filter() to get at the records with a particular user name in them:

     

    Filter(GalleryHome.AllItems,
     Label1.Text in // This label contains your name search string
     AcademicSupervisor.DisplayName // AcademicSupervisor is a people type column
    )

    You can substitute User().FullName for Label1.Text to query for the currently logged in user, or even hard code a search string such as "Richard"

     

    Is that what you are after?

  • BCLS776 Profile Picture
    8,994 Moderator on at

    Oh, and for a Person column with multiple choices enabled, use this:

     

    Filter(GalleryHome.AllItems,
     Label1.Text in // This label contains your name search string
     Concat(AcademicSupervisor.DisplayName, DisplayName) // AcademicSupervisor is a multi-people type column
    )
  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks @BCLS776 . I knew about the concat for multi-select people fields but had a complete brain block yesterday!

    This is the formula I used and it has worked:

    Set(varLast, Last(GalleryHome.AllItems.AcademicSupervisor));
    ClearCollect(colToUpdate, Filter(GalleryHome.AllItems, Not(Concat(varLast.AcademicSupervisor, Claims, "; ") = Concat(AcademicSupervisor, Claims, "; "))));
    ForAll(RenameColumns(colToUpdate, "ID", "NewID"),
    UpdateIf(Records, ID = NewID, Last(GalleryHome.AllItems.AcademicSupervisor)))

     

  • BCLS776 Profile Picture
    8,994 Moderator on at

    Wonderful! If your problem is solved, could you "accept a solution" so that others can benefit? It helps make the topic more searchable.

  • v-albai-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Glad that you have solved your issue. I will mark you reply as a solution so that other community members who stuck with the same question can directly see your answer.

    Best regards,

    Allen

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard