When a new SharePoint item is created via integrated Power Apps and the OnSuccess actions of the form (ResetForm and RequestHide) are disabled (or postponed to be called after some other action), after click on the save button, the first list item instead of the new created one is shown.
Sample use case:
Show a success message or send an email including values of the new item from inside the Power App. (Sending an email via Power Automate Flow is not always an option, for example if a user should be able to customize the message.)
Steps to reproduce:
Expected behavior:
The Power Apps Form shows the new created item.
Current behavior:
Another item is shown.
Additional Information:
In generated Power Apps, there is a function SharePointForm1.Item that looks like it should load the first item if SharePointIntegration.Selected is not set.
If(IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),First(<MyListName>),SharePointIntegration.Selected),
Changing First(<MyListName>) to Last(<MyListName>) has no effect. I assume SharePointIntegration.Selected is already set to the first item by SharePoint.
Possible Workaround:
Save the ID of the new created item in SharePointIntegration.OnSave
SubmitForm(SharePointForm1);
Set(myId,SharePointForm1.LastSubmit.ID)
and use it to load the new item in SharePointForm1.Item
If(IsEmpty(myId),
If(IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),First(<MyListName>),SharePointIntegration.Selected),
LookUp(<MyListName>,ID = myId))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.