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

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:

And OnCancel event:

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

And a label that uses the variable

(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

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

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

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)