cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AndrewValenzuel
Advocate II
Advocate II

Selected gallery item clears when I submit form

I've narrowed down the reason why my edit form is clearing when I submit.  The reason why is because my gallery is filtered based on the status of a ticket.  (the app is for service tickets btw).

 

When the gallery is set to filter out all tickets with a status of "closed", and I select and submit changes to a ticket with the status of "open", and set said ticket's status to "closed", the edit form clears all of the data.  

 

Is there a way where I can select a ticket based on another attribute other than TicketsGallery.Selected?  

 

Each ticket in the gallery has a unique ticket ID (the sharepoint ID column).  How can I select items in a gallery based on the ID instead of the edit form's default:  ITEM: TicketsGallery.Selected?

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @AndrewValenzuel ,

I assume the Status drop-down is not "connected" to any field in the gallery Items? If so, this is a known issue with unbound gallery controls resetting when something is done from or to the gallery.

If your Items are based on a Collection, use AddColumns to add a Text Field (I will call it ddText here) and on the OnChange of the DropDown, put this

Patch(
   YourCollectionName,
   ThisItem,
   {ddText:Self.Selected.Value}
)

then in the Default of the drop-down would then be

ThisItem.ddText

 

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.

 

Hi @AndrewValenzuel ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

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.

v-bofeng-msft
Community Support
Community Support

Hi @AndrewValenzuel :

Do you want to specify a record by ID instead of using TicketsGallery.Selected?

If so,please try:

LookUp(YourSharePointList,ID=1) /*I suppose to specify the item with ID=1*/

instead of

TicketsGallery.Selected

Best Regards,

Bof

Yes that is exactly what I want to do.  But my problem is that the gallery is filtered.  And when I submit a change to the item (suchas changing the status to "Closed") the filtered gallery no longer has that item in view, because the is filtered by the item's status: "Closed, Open, In-Progress, Canceled...".

 

I'll try this when I get the chance, thanks for your input.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,625)