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 / Using ForAll Function
Power Apps
Unanswered

Using ForAll Function

(0) ShareShare
ReportReport
Posted on by 166

Hello,

i have a sharepoint list with parcels that receivers should mark as received by using a link in an email. Of course not everybody does. So in a powerapp i have a datatable which is filtered to all parcels older than 30 days and not marked as received:

 

Sort(Filter(Paketeingangsliste;Erstellt < DateAdd(Today();-30);IsBlank(Abholer)=true);ID;Descending)

 

I would like to a have a button that marks all entries as received by clicking on it. That means to write a certain user (i.e. Müller Hans) in column "Abholer" which is of type person/contact for all entries in the datatable.

I think it's possible to do that with the ForAll-Function but i am not sure how.

 

Can you help me?

Thank you.

Categories:
I have the same question (0)
  • Verified answer
    WiZey Profile Picture
    3,023 Moderator on at

    Hello @JürgenD ,

     

    The most optimal way is to combine "Patch()" and "ForAll()" to batch update a SharePoint list.

     

    Patch(
     source;
     ShowColumns(
     collection;
     "ID"
     );
     ForAll(
     collection;
     { 
     column1: value1;
     column2: value2;
     ...
     }
     )
    )

     

    "ShowColumns()" return a table with every ID of the records you want to update. Be sure the ID match between the collection or the source, otherwise PowerApps may create new records instead of updating existing ones.

     

    "ForAll()" then return a table with every column you want updated. The columns' names MUST match with the source, otherwise it may gives unexpected results.

     

    Replace "collection" in my code with the list of all your unmarked items and it should work.

     

    Hope this was helpful to you.

  • Verified answer
    JürgenD Profile Picture
    166 on at

    Hello @WiZey 

    thank you for your help.
    But there is one thing, i don't understand: 

    When I put your code to the onselect-property of a button, how do i get the relation to the filtered list (see filter string at the beinning of the post)? 

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard