cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dhwu
Frequent Visitor

Editing list item from both SharePointIntegration.Selected and Gallery.Selected

I'm creating a form that allows users to select and edit an existing item from a gallery, using the Navigate/Edit Form functions in the OnSelect field of a button in the gallery, and the Gallery.Selected function in the Item field on the form.

 

However, I'd also like to be able to select and edit items via the underlying SharePoint list, as with SharePointIntegration.Selected function. Currently, I can only edit the form if I go through the gallery. If I try to select an item from the list, it gives me the item I last opened in the gallery instead of what I actually selected.

 

How can I include both edit options?

1 REPLY 1
RandyHayes
Super User
Super User

@dhwu 

Consider using a variable for your Gallery selection.

Set the OnSelect formula to include:  Set(glbCurrentRecord, ThisItem)

 

Then change your Item property of your form to:

   Coalesce(glbCurrentRecord, SharePointIntegration.Selected)

 

The gallery selection will then show if it is selected and if nothing is selected, then the integration selected record will show. 

 

If you need to at some point revert back to the integration record after a gallery item is selected, then simply put a Set(glbCurrentRecord, Blank()) where ever it is appropriate. 

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

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 (5,719)