Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Data won't patch if container inside the gallery

Like (0) ShareShare
ReportReport
Posted on 18 Oct 2023 02:11:08 by 64

Hi,

I'm struggling to get the data patch from Gallery to collection.

So I have a container inside the gallery, how do I get all the update in the collection?

Spaceballs_0-1697595032983.png

 

ClearCollect(colEvidenceRecord, EvidenceRecordGallery.AllItems)

 

Categories:
  • Michael E. Gernaey Profile Picture
    41,362 Super User 2025 Season 1 on 18 Oct 2023 at 05:27:00
    Re: Data won't patch if container inside the gallery

    @Spaceballs 

     

    Does the ClearCollect not give you the items? if you want them all that should in fact work, what error are you getting? I wasn't sure you wanted them all, so I was showing how to patch a single one.

     

    If you want you could do

     

    ForAll(MyGallery.AllItem,

        Collect(MyCollection,

                 { 

                      MyCollectionField1: ThisRecord.Field1,

                      MyCollectionField2: ThisRecord.Field2,

                      MyCollectionField3: ThisRecord.Field3

                 }

    )


    If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others

    Cheers

    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • Spaceballs Profile Picture
    64 on 18 Oct 2023 at 04:43:05
    Re: Data won't patch if container inside the gallery

    Hi @FLMike ,

    Yes, I have a button outside of the gallery. Inside the gallery there is a container and within the container there is input. 

    I want to loop through the gallery. Forall function would be appropriate and the gallery should be allitems. 

  • Michael E. Gernaey Profile Picture
    41,362 Super User 2025 Season 1 on 18 Oct 2023 at 02:55:01
    Re: Data won't patch if container inside the gallery

    Hi @Spaceballs 

     

    So Assume you have a button outside the gallery, the Patch would look like this (of course you have to include your properties etc, this is a template example only)

     

    Patch(MyCollection, MyGalleryName.Selected,

          {

               CollectionField1: MyGalleryName.Selected.Field1,

               CollectionField2: MyGalleryName.Selected.Field2,

               CollectionField3: MyGalleryName.Selected.Field3

          }

    )

     

     


    If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others

    Cheers

    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,700 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard
Loading started