I am using CDS & have a screen with a Gallery & Form. The selected gallery item populates the form & the form can be edited.
My problem is however, that the gallery selection gets lost when I execute Refresh(Database).
Is there a way either to retain the gallery selection when a form is submitted, or to re-select the previous item after a form has been edited (and the database refreshed)?
Thanks!
Solved! Go to Solution.
Hi @Medoomi,
What you can do for the OnSelect() of your Refresh Button is something like this:
Set(varSelectedItemID, Gallery1.Selected.Id);
Refresh(Database)
Now on the Default() of you Gallery you can do something like this:
LookUp(Database, Id = varSelectedItemID)
Hope this helps.
Try these steps:
1. OnVisible of the screen put:
If(GallerySelected,Gallery4.Selected,If(!GallerySelected,Gallery2.Selected))
Change Gallery2 to your existing Gallery connected to the form
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Hi @Medoomi,
What you can do for the OnSelect() of your Refresh Button is something like this:
Set(varSelectedItemID, Gallery1.Selected.Id);
Refresh(Database)
Now on the Default() of you Gallery you can do something like this:
LookUp(Database, Id = varSelectedItemID)
Hope this helps.
Thanks so much for your answer. I'm trying to understand the process. Am I correct thinking that Gallery4 would become a kind of "holding place" for the previously submitted form... So in practice, once the form was submitted, while Gallery2 might become de-selected, the form selection would remain?
The idea is to be able to choose from either Gallery2 which holds the existing record and Gallery 4 which holds the latest submitted item.
You have a choice of selection between the two at any point in time.
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
204 | |
180 | |
62 | |
32 | |
30 |
User | Count |
---|---|
324 | |
270 | |
104 | |
74 | |
56 |