cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dB4
Helper III
Helper III

Mobile PowerApp - Entering location, date & time and Text.

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??

7 REPLIES 7
RandyHayes
Super User
Super User

@dB4 

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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes 

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.

@dB4 

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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes 

Thx again, well, tbh, i will have to look for your suggestions coz im an entry-level @ powerapps.

At least its feasible!

RandyHayes
Super User
Super User

@dB4 

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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

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:

FlowFlow

 

 

 

 

 

 

 

 

 

 

SP Custom list columns:

sp list.PNG

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.

 

PA.PNG

 

 

 

RandyHayes
Super User
Super User

@dB4 

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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (1,538)