cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

PowerApps SharePoint Integration: Global variable

Hello friends,

I have an issue. I have a list on the SharePoint Site that looks:

Smile1_0-1601279329934.png

Then I have tried to customize Edit Form on PowerApps that uses a global variable for the SharePointIntegration.Selected record.

I have added the following code OnEdit event of SharePointIntegration component:

Smile1_4-1601280031707.png

And OnCancel event:

Smile1_5-1601280110221.png

On the screen, I have a form that uses the SharePointIntegration.Selected record as Item

Smile1_6-1601280216809.png

And a label that uses the variable

Smile1_7-1601280281332.png

(All the following photos contain a part of the SharePoint list on the left side and custom PowerApps in Edit mode on the right)

And then when I open the form on the SharePoint first time everything works well

Smile1_1-1601279510919.png

Then I close the form and try to open it for another record and it works for but not for my variable.

Smile1_2-1601279574803.png

If I open third time another record the form works but a variable shows me the second record.

Smile1_3-1601279688569.png

So, do you happen to know how to set a global variable properly?

(I understand that I may use the SharePointIntegration.Selected record for the label as well but my purpose is to use this record for setting other variables)

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: PowerApps SharePoint Integration: Global variable

Hi @Smile1 ,

 

Yes, I can also reproduce your issue, and can't find out the reason of this issue for the time being.

However, here is another workaround, change to use LookUp function to retrieve back the record upon the 'SharePointIntegration.SelectedListItemID', rather than 'SharePointIntegration.Selected'.

Please try to modify the code as follows.

Set(
    SelectedWorkflow,
    If(
        IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),
        First([@'SP list']),
        LookUp('SP list',ID= SharePointIntegration.SelectedListItemID)
    )
);

Hope this helps.

Sik

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: PowerApps SharePoint Integration: Global variable

Hi @Smile1 ,

 

Yes, I can also reproduce your issue, and can't find out the reason of this issue for the time being.

However, here is another workaround, change to use LookUp function to retrieve back the record upon the 'SharePointIntegration.SelectedListItemID', rather than 'SharePointIntegration.Selected'.

Please try to modify the code as follows.

Set(
    SelectedWorkflow,
    If(
        IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),
        First([@'SP list']),
        LookUp('SP list',ID= SharePointIntegration.SelectedListItemID)
    )
);

Hope this helps.

Sik

View solution in original post

Highlighted
Regular Visitor

Re: PowerApps SharePoint Integration: Global variable

Thanks, it works.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (4,391)