Hello community,
I've crossed to a template but cannot locate it right now.
We want to build a PowerApp for mobile devices with two simple functions.
For End-User's side:
1 button that will retrieve location, date & time
1 field to enter data - not more than a sentence.
All above data will be stored in an Excel online or even better represented in a SharePoint list.
Feasible??
Yes, all very feasible. PowerApps has Location services through the Location function. You can capture that as well as any text in a textinput control and save it into a datasource - and that datasource can be Excel.
I hope this is helpful for you.
Hey Randy, many thanks for your swift reply.
Date/Time/Location should be retrieved automatically using 1 button/click, and cannot be modified from End-User.
Sure thing. Just store it directly in your list/datasource on the 1 click, or store in a variable to be stored at another point in time.
Thx again, well, tbh, i will have to look for your suggestions coz im an entry-level @ powerapps.
At least its feasible!
Yes, definitely feasible.
In general, the Location object in PowerApps is always updating based on the device location.
You can certainly capture the location into a variable with a button. Something like this:
Set(currentLocation, Location)
This will then give you a snapshot of the Location at the point that the button is pressed. Location has Altitude, Latitude, and Longitude information in it. (i.e. currentLocation.Latitude would give you the value stored in the variable for latitude)
Similarly, the Date and Time can be captured : Set(currentDateTime, Now())
I would suggest looking at some of the Template examples in PowerApps as most connect to an Excel datasource and will give you some more guidance on connecting to Excel as a datasource.
One thing to note (that many get trapped with), you should consider your Excel file to be for PowerApps only. In other words, you would not want to have users interacting with the Excel file from that point on or modifying it as it would have potentially bad impact on your app.
Update.
@RandyHayesunfort., cannot follow your suggestions due to lack of PA skills.
By googling, i've created a Flow, trigger is PowerApps and as 2nd Step it creates record in SP custom List.
Flow:
Flow
SP Custom list columns:
Now in PowerApps, i've created a 'Text input' box where user enters his credentials and below is the Submit button, where registers his EmpName, location and current time.
BUT cannot get that to work.
Formula used for Submit button is the below (savelocation is PA title)
SaveLocation.Run(FirstName.Text,Location.Longitude,Location.Latitude,Now()
Cannot get the text entered in PA text input field into SP custom list.
Why are you trying to create a PowerAutomate flow for this? You can do it all directly in your App.
1) Connect your powerAppTest list as a datasource in the app.
2) Change your OnSelect formula on the button to the following:
Patch(powerAppTest,
Defaults(powerAppTest),
{EmpName: FirstName.Text,
'Location Longitude': Location.Longitude,
'Location Latitude': Location.Latitude,
Time: Now()
}
)
And you are done.