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 / ForAll working with ma...
Power Apps
Answered

ForAll working with manually filled collection but not with filtered Table

(0) ShareShare
ReportReport
Posted on by

Hi,

the last statement is red underlined:

 

ClearCollect(colToSpooler; Filter(Gallery2.AllItems; Checkbox1.Checked));;
ClearCollect(uuu; { Ort: "Berlin" }; { Ort: "London" });;
ForAll(uuu; Patch(BK_Emailvalidierung_Spooler; Defaults(BK_Emailvalidierung_Spooler); { SpoolerName: "Oliver"; Startdatum: Today() }));;
ForAll(colToSpooler; Patch(BK_Emailvalidierung_Spooler; Defaults(BK_Emailvalidierung_Spooler); { SpoolerName: "Oliver"; Startdatum: Today() }));; // is marked red

 

ColToSpooler is shown corrrectly in an Gallery.

Why is ForAll(uuu ... working correctly and ForAll(colToSpooler ... is marked with a red line (and not working)?

 

Thanx

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    154,447 Most Valuable Professional on at

    Hi @pingun ,

    Assuming the fields in BK_Emailvalidierung_Spooler of SpoolerName is Text and Startdatum is a Date, I am not sure why it is invalid, however you are not patching anything from the gallery/collection. 

    Assuming for example SpoolerName exists in the gallery data, you can also do this

    ForAll(
     Filter(
     Gallery2.AllItems; 
     Checkbox1.Checked
     ) As aSpool; 
     Patch(
     BK_Emailvalidierung_Spooler; 
     Defaults(BK_Emailvalidierung_Spooler); 
     {
     SpoolerName: aSpool.SpoolerName; 
     Startdatum: Today() 
     }
     )
    );;

    is this what you are trying to do?

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

     

  • pingun Profile Picture
    on at

    Hi@WarrenBelz,

    thanks a lot! Is working.

    To get it to work at all, I tried static data. Therefore I didn't need a reference to the contents. In the meantime I had also tried with "As"...
    Therefore I have to make the detour over the Collections.

    But why does the above example not work? Any idea?

    I've tried it this way too, but without the "As". So I trid

  • WarrenBelz Profile Picture
    154,447 Most Valuable Professional on at

    Hi @pingun ,

    I must admit I have never tried a ForAll Patch and then not used any of the output from the Items in the Patch, however when I think about it technically, it should work and simply post the number of new records that are in the dataset referenced, but in reality you would never do this.

    The As statement is simply a very effective disambiguate tool and I only used it to demonstrate how to Patch a field when the name in both the source and target are the same. If the matching fields are named differently, you do not need it. You can still Patch the gallery contents directly.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 542 Most Valuable Professional

#2
Haque Profile Picture

Haque 206

#3
Kalathiya Profile Picture

Kalathiya 201 Super User 2026 Season 1

Last 30 days Overall leaderboard