cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
martinav
Resident Rockstar
Resident Rockstar

ForAll statement for Gallery Items

I have a complex Items statement for a Gallery.  I would like to apply a ForAll statement separate from the main statements driving Items, for sake of keeping things more orderly.  I know I can wrap the statement around the entire items statement as "source" for the ForAll(), but that gets so ugly.  I was hoping to apply ForAll, using Gallery.AllItems as the source.  Is this possible?

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User III
Super User III

@martinav 

Yes, you can use a ForAll on the AllItems of a Gallery:

   ForAll(yourGallery.AllItems, ...

You can even filter by conditions in the Gallery - such as a checkbox:

   ForAll(Filter(yourGallery.AllItems, checkBox.Value), ...

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

3 REPLIES 3
RandyHayes
Super User III
Super User III

@martinav 

Yes, you can use a ForAll on the AllItems of a Gallery:

   ForAll(yourGallery.AllItems, ...

You can even filter by conditions in the Gallery - such as a checkbox:

   ForAll(Filter(yourGallery.AllItems, checkBox.Value), ...

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

I think my issue was I was doing this after the main statement in the Items control of the gallery.  I'm guessing that has circular logic.  I'm guessing this needs to be in a button OnAction or something outside of the gallery. 

 

I have found a way to re-arrange my items to make it simpler anyway.  I'll close this and revisit later if needed.

 

@martinav 

Ah yes, I had assumed you had this on a button or some other action.  Right, you would not have this in the items property of the Gallery as that would definitely be circular.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (56,489)