cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

SharePointIntegration.Selected gives me last opened item

Hi! I am trying to get a SharePoint item field value in Power Apps OnEdit event using SharePointIntegration.Selected.MyFieldName. But this gives me the last opened item field value. Why? 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @Anonymous ,

Could you please share a bit more about your issue?

Do you mean that the SharePointIntegration.Selected.MyFieldName formula would still return previous selected item value when you edit another item in your SP List?

 

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. Please take a try with the following fixed solution:

Set the OnEdit property of the SharePointIntegration control to following:

Refresh('Your SP List');  // Add formula here
Set(Var1, SharePointIntegration.Selected.MyFieldName);   // save the formula result into a variable
EditForm(SharePointForm1)

 

In addition, you could also consider use the following formula to retrieve the field value of the selected item:

LookUp('Your SP List', ID = SharePointIntegration.SelectedListItemID, MyFieldName)

or

LookUp('Your SP List', ID = SharePointIntegration.SelectedListItemID).MyFieldName

 

Please consider take a try with above solution, 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.

View solution in original post

2 REPLIES 2
WarrenBelz
Super User III
Super User III

Hi @Anonymous ,

The field name in SharePointIntegration.Selected will certainly be the last one you selected back in SharePoint as that is exactly what that term means.

You might try setting a variable in the OnChange of the field control concerned and refer to this when asking for the value it was changed to.

 

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-xida-msft
Community Support
Community Support

Hi @Anonymous ,

Could you please share a bit more about your issue?

Do you mean that the SharePointIntegration.Selected.MyFieldName formula would still return previous selected item value when you edit another item in your SP List?

 

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. Please take a try with the following fixed solution:

Set the OnEdit property of the SharePointIntegration control to following:

Refresh('Your SP List');  // Add formula here
Set(Var1, SharePointIntegration.Selected.MyFieldName);   // save the formula result into a variable
EditForm(SharePointForm1)

 

In addition, you could also consider use the following formula to retrieve the field value of the selected item:

LookUp('Your SP List', ID = SharePointIntegration.SelectedListItemID, MyFieldName)

or

LookUp('Your SP List', ID = SharePointIntegration.SelectedListItemID).MyFieldName

 

Please consider take a try with above solution, 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.

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (38,072)