I was recently building an app from scratch (start from blank not a template) that leverages a couple of SharePoint lists both of which the app writes items to at different times.
When I encountered the message “Getting you data …” which is not strictly speaking an error but was definitely an issue.
I had followed the usual process for building a new entry function in PowerApps.
I added the data connection to the relevant lists, added a new Entry Form to a new blank page, connected the Entry Form to the connection and added a Submit control to the bottom of the page. From the OnSelect event on a control on the home page of the app I create an instance of form in New mode and navigate to it. So far so good, everything is working as expected, field validation stops submission of the form but when I submit a valid form I am presented with a blank (no fields showing) form and the message “Getting you data …”. It remains in this state until I navigate off the page or close the app and interestingly the information I had entered into the form has been successfully submitted to the SharePoint list.
This baffled me for some time. I have created apps from templates in the past that worked as I expected this one to work (i.e. after the form is successfully submitted the user is returned to the home page) but in this case I was building the forms by hand, no template involved. I thought maybe I have missed some configuration on the control to submit the form, no, it wasn’t that. I tried adding some logic to the control around the submit so that if the form was valid the submit was run and then the user was navigated back to the home page. Whilst this worked for a valid form if the form had any invalid fields it wouldn’t hit the submit function and hence the user wasn’t shown the invalid field and associated error messages. I tried making sure that the Item property of the Entry Form control was set as some suggestions included this as a technique to fix the problem. In my case I’m not in a Gallery control or using one that I could reference so all I had available was to set it to EntryForm.LastSubmit. This succeeded in removing the “getting your data” message but left the completed form on the screen rather than send the user back to the app’s home page. Exactly what you would expect I guess.
PowerApp was doing exactly what I had configured it to do…
I finally worked out what was needed to complete the submission process in the way I was expecting. PowerApps wasn’t encountering an error as such as in my case I wasn’t letting the Entry Form control know what to do once it had been submitted successfully. In this case without the Item property set it was left ‘Getting your data’ but with no information about where to get it from. Once I gave it EntryForm.LastSubmit as the place to go for item data the form again did exactly what it should…after it was submitted it displayed the data from the last submitted record. What I actually needed to do was to tell the Entry Form control what to do after the successful submission of an item, that is configure the OnSuccess property of the Entry Form control. In this case I simply added a Navigate function to send the user back to the home page of the app and the app now worked as I expected. I actually don’t even need the Item property to be set in this case as the app only allows for entry of records not editing or displaying.