Category Archives: PowerApps

“getting your data” message after a PowerApps new form submission

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.

Advertisements

Leave a comment

Filed under Office 365, PowerApps, PowerApps, SharePoint Online, Uncategorized

Fiscal year/quarter calculations

I have been doing some work in Microsoft PowerApps recently and found that as part of one of the application requirements it was necessary to calculate for the user the current fiscal year (e.g. FY19) as well as the current fiscal quarter (e.g. Q1, Q2, Q3 or Q4). This information was then used to pre-populate the relevant fields in the data entry form, disabled so they can’t be changed.

Here are the expressions I use in the Default field for the relevant text boxes.

Fiscal Year
If(Month(Today())>6,"FY"&Right(Text(Year(Today())+1),2),"FY"&Right(Text(Year(Today())),2))
Fiscal Quarter
"Q" + RoundUp((If(Month(Today()) >= 7 , Month(Today()) - 6,Month(Today()) + 6 )/3),0)

Not long after this was implemented the requirement was change so that the app should be setting these values based on what they would be for the following month. For example normally June this would be FY18 and Q4 but with this change they should instead by FY19 and Q1. This means September will still be FY19 but Q2 instead of Q1.

Here are the revised expressions I use in the Default field for the relevant text boxes.

Fiscal Year a Month in Advance
If(Month(Today())>=6,"FY"&Right(Text(Year(Today())+1),2),"FY"&Right(Text(Year(Today())),2))
Fiscal Quarter a Month in Advance
"Q" & RoundUp((If(Month(Today())+1 >= 7  , Month(Today()) - 5,Month(Today()) + 7 )/3),0)
Fiscal Year a Fiscal Quarter in Advance
If(Month(Today())>=4,"FY"&Right(Text(Year(Today())+1),2),"FY"&Right(Text(Year(Today())),2))
Fiscal Quarter a Fiscal Quarter in Advance
"Q" & RoundUp ((If( Month(Today())+3 >= 7  , Month(Today()) - 3,Month(Today()) + 9 )/3),0)

Leave a comment

Filed under PowerApps, SharePoint Online, Uncategorized