cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
landonjochim
Resolver II
Resolver II

Gallery.AllItems within Form cannot be Collected

Good morning,

 

I have an Edit Form which I am displaying some fields. I have added a Custom Card to this Form. Within the Custom Card I have a Gallery displaying this information:

  • Title
  • Image
  • Dropdown

I have a button with an OnSelect Property of the following:

Clear(colAttachmentData);
ForAll(
    Gallery1.AllItems,
    Collect(
        colAttachmentData,
        {
            Title: Title1.Text,
            DataStream: Image1.Image,
            DocumentType: TypeDropdown.Selected.Value
        }
    )
);

When the button is selected, nothing happens. The colAttachmentData collection does not get populated with anything.

 

However, when the gallery is added outside of the Edit Form, everyone works perfectly. I want the gallery to be within the form so it is showing apart of the other cards in the Form.

 

Please help if you know a work around.

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @landonjochim ,

I have some bad  and good news from some testing I just did. It seems you cannot refer to a gallery inside a form from outside the form (you do not get any error, it just does not action anything as you have found). If you put the button inside the card with the gallery, it works perfectly.

So here is the workaround - put your button inside the card and hide it. Put another button where you want it with the code

Select(YourFirstButtonName)

 

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.

View solution in original post

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @landonjochim ,

I have some bad  and good news from some testing I just did. It seems you cannot refer to a gallery inside a form from outside the form (you do not get any error, it just does not action anything as you have found). If you put the button inside the card with the gallery, it works perfectly.

So here is the workaround - put your button inside the card and hide it. Put another button where you want it with the code

Select(YourFirstButtonName)

 

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.

Oh nice. That will work! Thanks for the response and taking the time to test for yourself.

 

Landon 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,649)