web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : HibyE6jVJ58197yQ9mtKWA
Power Apps - Building Power Apps
Answered

How to display Lat and long in a push notification

Like (0) ShareShare
ReportReport
Posted on 24 Sep 2020 04:30:20 by 19

Hi Guys,

     I'm setting up a push notification for check-in and distress, using the 'push a PowerApps button to send a push notification' automation, the code checks out OK:

OKbutton.Run(User().FullName & " OK") & ((Location.Latitude & Location.Longitude) & Notify("Checkin has been transmitted", NotificationType.Success))

 

I get the 'User.OK' message transmitted and the success notification on the app, but no position info, I've had a look through the forum and the googles and can't come up with a solution, am pretty new to this so hoping it's something very simple that I've overlooked.

 

Any help is appreciated.

 

Thanks

 

Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    on 09 Oct 2020 at 01:23:46
    Re: How to display Lat and long in a push notification

    Hi @JLaw973 :

    Glad to know that your problem has been solved.

    Please consider Accept your solution as the 'solution' to help others.Thanks.

    Best Regards,

    Bof

  • Verified answer
    JLaw973 Profile Picture
    19 on 08 Oct 2020 at 05:25:10
    Re: How to display Lat and long in a push notification

    So finally got there, the flow was just a template send push notification through powerapps, for some reason I need to add a space to the code for the lat long to be clear, so the final code (that's relevant) is this:

    User().FullName & " " & (myLocation.name &" "& Location.Latitude &" " & Location.Longitude) & (" Checked in OK")) &

    Navigate(Thanks) & Notify("Checkin has been transmitted", NotificationType.Success));

     

    That seems to have done it, I've since changed from push notification to Twilio SMS and Send Email.

     

    Also the laptop isn't sending a location through clearly, but works well on the phone.

     

    Thanks for your help

     

     

  • v-bofeng-msft Profile Picture
    on 02 Oct 2020 at 01:06:42
    Re: How to display Lat and long in a push notification

    Hi  @JLaw973 :
    Has the problem been solved?
    Is there anything else I can help?
    If my post helps, then please consider Accept it as the solution to help others.Thanks
    Best Regards,
    Bof

  • JLaw973 Profile Picture
    19 on 30 Sep 2020 at 11:17:31
    Re: How to display Lat and long in a push notification

    Thanks Bof, will try and sort out laptop location, should save some time!

  • v-bofeng-msft Profile Picture
    on 30 Sep 2020 at 02:39:40
    Re: How to display Lat and long in a push notification

    Hi @JLaw973 :

    Do you want to send the longitude and latitude of the user currently using this app to the specified user through the flow named OKbutton?

    If this is the case, it is best to see how your flow is set up.Currently I suggest you try this formula:

     

    OKbutton.Run(User().FullName & " OK" & Location.Latitude & Location.Longitude);
    Notify(
     "Checkin has been transmitted", 
     NotificationType.Success
    )

     

    In addition, I am not sure why your laptop cannot get the latitude and longitude. Maybe this link can help you:

    https://support.microsoft.com/en-us/help/4468240/windows-10-location-service-and-privacy

     Best Regards,

    Bof

  • JLaw973 Profile Picture
    19 on 30 Sep 2020 at 02:16:57
    Re: How to display Lat and long in a push notification

    Hi Bof,

       Apologies for the delay, this is about the 3rd time I've replied but everytime I come back and check, the reply isn't there - not sure what's going on...

       Thanks for taking the time to reply, I think your code is almost there but I didn't explain myself correctly, so apologies for that.

     What I'm looking for is the flow notification to an external user that says the user is OK, and their lat/long

    For the user, I'd just like them to have a notification that the Checkin was transmitted OK, no other data required.

     

    I think half the battle I'm having is using a laptop to create the app that isn't providing lat/long, so I need to update and publish the app before using a phone to check it's working.

     

    Thanks again

     

  • v-bofeng-msft Profile Picture
    on 25 Sep 2020 at 06:34:36
    Re: How to display Lat and long in a push notification

    Hi @JLaw973 :

    Do you want the current location information to appear in Success Notify?

    If so,let me explain why the Lat &loc did not appear.

    The key is syntax.Because your flow and notify can be executed successfully, I judge your formula should be placed in a behiver property. However, the value of (Location.Latitude & Location.Longitude) is a plain text, and it is meaningless to put it in a behiver property.

    Please try this code:

     

    OKbutton.Run(User().FullName & " OK");
    Notify(
     Location.Latitude & Location.Longitude & "Checkin has been transmitted", 
     NotificationType.Success
    )

     

    I hope this can hlpe you.If my understanding is wrong, please help me point it out.

     Best Regards,

    Bof

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Tom Macfarlan – Community Spotlight

We are honored to recognize Tom Macfarlan as our Community Spotlight for October…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 885 Most Valuable Professional

#2
developerAJ Profile Picture

developerAJ 571

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 352 Super User 2025 Season 2

Last 30 days Overall leaderboard