cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dave8
Impactful Individual
Impactful Individual

How can I make desired item selected in gallery control?

Hello,

 

I have a gallery control and edit form connected with SharePoint list.

 

In the form, after I submit an item, It displays on the gallery, however, gallery control selects first item in the list as selected.

 

How can I make submitted item selectable in gallery control in the same screen?

 

Thanks,

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @dave8 ,

Set the Default property of the Gallery to following:

If(
   !IsBlank(SubmittedRecord),
   LookUp('Your SP List', ID = SubmittedRecord.ID)
)

Please make sure the SubmittedRecord variable has been populated with proper record value after your submit your form data successfully.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
eka24
Super User
Super User

For clarification, do you want the new submitted item on the Gallery?

Does it mean you cannot find the new item in the Gallery.

 

I hope the Gallery is connected to the datasource and not a Collection

------------

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.

v-xida-msft
Community Support
Community Support

Hi @dave8 ,

Could you please share a bit more about your scenario?

Do you want the submitted record to be selected within your Gallery?

 

Based on the needs that you mentioned, I think a variable could achieve your needs. Please take a try with the following wrokaround:

Set the OnSuccess property of the Edit form to following:

Set(SubmittedRecord, EditForm1.LastSubmit);   // Add formula here
Back()

Set the Default property of the Gallery (BrowseGallery1) to following:

SubmittedRecord

Set the TemplateFill property of the Gallery to following (highlight the selected item within the Gallery😞

If(
   ThisItem.IsSelected,
   RGBA( 250, 235, 215, 1 ), 
   RGBA(0, 0, 0, 0)
)

 

Please take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
dave8
Impactful Individual
Impactful Individual

Hi @v-xida-msft 

Your understanding is correct, however following is not working as expected:

Set the OnSuccess property of the Edit form to following:

Set(SubmittedRecord, EditForm1.LastSubmit);   // Add formula here
Back()

Set the Default property of the Gallery (BrowseGallery1) to following:

SubmittedRecord

It always shows first item as selected after submit - Any clue?

 

Thanks,

v-xida-msft
Community Support
Community Support

Hi @dave8 ,

Set the Default property of the Gallery to following:

If(
   !IsBlank(SubmittedRecord),
   LookUp('Your SP List', ID = SubmittedRecord.ID)
)

Please make sure the SubmittedRecord variable has been populated with proper record value after your submit your form data successfully.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (1,870)