cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jk213
Frequent Visitor

Collect with Forall not working

Hi All,

 

i am trying to create a collection with Forall based upon gallery all items however the code does not seem to work. Below is my code

Clear(colsubmissiondetails);   /* <-- Add this formula to get rid of duplicated records in this tempCollection */
ForAll(
       packagedetails.AllItems,
       Collect(
               colsubmissiondetails,
               {
            Quantity:ThisRecord.txtQuantity.Text,
            Rate: ThisRecord.txtRate.Text,
            Total:ThisRecord.txtTotal.Text,
            Lengthininches: ThisRecord.txtLength.Text,
            Heightininches: ThisRecord.txtHeight.Text,
            Widthininches:ThisRecord.txtWidth.Text,
            Amount:TextInput1.Text
               }
      )
)

My Gallery item is the collection name ( colsubmissiondetails )
Can anyone please help out?

3 REPLIES 3
PowerAddict
Super User
Super User

Hi @jk213,

 

Are you saying that you have a gallery which is using colsubmissiondetails as its Items property and it is not showing any details?

 

---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions. 

 

Thanks!

Hardit Bhatia

Microsoft Business Applications MVP

Microsoft Certified Trainer MCT

Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

@PowerAddict Actually, i have a save button which saves all the data of the gallery back to the collection. But it is not working and also the gallery that i am taking data from has Colsubmissiondetails as items

v-qiaqi-msft
Community Support
Community Support

Hi @jk213

Have you solved your problem?

Do you mean that the collection could not display in the Gallery?

Could you please describe more about your scenario?

 

Actually, the formula you provided does cause the error you have.

The Clear() function will clear the colsubmissiondetails firstly, so all of the formula behind make no sense, so that you could not cover the colsubmissiondetails with the updates.

 

If you just want to create a collection to write back the updates, I think you could use the ClearCollect() directly.

ClearCollect(
              colsubmissiondetails,
              packagedetails.AllItems
)

 

Best Regards,
Qi

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (1,825)