web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Bug: SharePointIntegra...
Power Apps
Unanswered

Bug: SharePointIntegration actions

(1) ShareShare
ReportReport
Posted on by 14

I need to set a field value to a variable when the form loads. I added Set(myVar,SharePointIntegration.Selected.Title) to OnEdit, but this method doesn't work consistently. Half of the time, the variable would show the value of the previously opened item.

 

The screenshot shows myVar is equal to "Orange" from another item. It'll change to "Apple" if I manually execute the Set function again by clicking the button. This behaviour seems to happen only when the form takes a little longer to load than usual.

 

PowerApps Bug 2.pngPowerApps Bug.png

Categories:
I have the same question (0)
  • v-micsh-msft Profile Picture
    Microsoft Employee on at

    Hi @Bee,

     

    Thanks for the feedback.

    Please try to add:

    Set(myVar,"")

    Under OnCancel and OnSave property of the SharePointintegration part.

    See if this would make any difference.

     

    Regards,

    Michael

  • Bee Profile Picture
    14 on at

    Hi @v-micsh-msft

     

    I've tried your sugestion but it didn't make any difference.

     

    This bug occurs much more frequently in edit mode. It only happened around 1 out of 20 times in view mode.

     

    The action is slow enough to witness. When the form loads up, the Title and myVar values are from the previous item. In a split second, both fields get updated to the current item values. I can see that myVar doesn't change when the Title field changes. Seems like the Set function is not executing properly sometimes.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I am having the same problem, or a very similar one.  The first time I Edit an item, the field is coming up blank.  The second time and following, it seems to be OK.  When I tried the suggestion above, the first time it comes up blank, the second time, it comes up with the value from the row that was selected first, and the third time and following it seems to be OK.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    FYI, here is the code from SharepointIntegration.OnEdit:

     

    Set(varRequestStatus,SharePointIntegration.Selected.Status); EditForm(frmNew)

  • ChemaMateos Profile Picture
    32 on at

    Try this

    Set(varRequestStatus,LookUp( 'NAME OF YOUR LIST', ID=SharePointIntegration.SelectedListItemID , Status))

  • ChemaMateos Profile Picture
    32 on at

    It's a Bug.

     

    Try this (OnEdit and Onview)

    Set(myVar, LookUp( 'NAME OF YOUR LIST', ID=SharePointIntegration.SelectedListItemID , Title))

  • mj2 Profile Picture
    24 on at

    This worked for me. How should we report such nasty bugs ?

  • RFreeman Profile Picture
    5 on at

    This worked sporadically for me.  Turning on the Experimental Feature for Formula-level error management seemed to help.  Seems odd.

    Please upvote the following so we have a better way to deal with new edit form loads.:  https://powerusers.microsoft.com/t5/Power-Apps-Ideas/OnInitialized-or-OnLoad-Behavior-Formula-needed-for-SharePoint/idc-p/640285#M31402

  • LilyTheDog Profile Picture
    2 on at

    I have found that in order for SharePointIntegration.Selected to be set the SharePoint item must be selected. If you go through the SharePoint item menu and click edit then SharePointIntegration.Selected does not get set - it will show the previously selected list item.

     

    I believe this is a bug

  • Spinner Profile Picture
    118 on at

    3 years later and this bug still seems to be present. I'm trying to look up items in a different list based on one field of the selected list item, but much of the time the lookup is based on the field in the previously selected list item.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 316 Most Valuable Professional

#2
11manish Profile Picture

11manish 242

#3
Valantis Profile Picture

Valantis 198

Last 30 days Overall leaderboard