cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Kesh
Level: Powered On

initialize variables zip code and city with bing map get location by point

Hi everyone!

in my CDS I have GPS point and I would like to create a flow that fill the zip code and the city in the same CDS.

How could I split zip code and city from the result of a "get location by point"?

kind regards

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: initialize variables zip code and city with bing map get location by point

 

Try this expression:

trim(replace(trim(split(body('Get_location_by_point')?['name'],',')[1]),body('Get_location_by_point')?['address']?['postalCode'],''))

Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
Gristy
Level 10

Re: initialize variables zip code and city with bing map get location by point

There is a variable that is returned for Postal Code. 

 

You will need to do string manipulation for the City though.

 

Here is a quick reference: https://faustocapellan.com/2018/05/01/express-yourself-string-functions-in-microsoft-flow/

Community Support Team
Community Support Team

Re: initialize variables zip code and city with bing map get location by point

 

Hi @Kesh ,

 

Please try this configuration to get zip code and city name:

123.PNG

Expression reference:

trim(split(body('Get_location_by_point')?['name'],',')[1])

Hope it helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Kesh
Level: Powered On

Re: initialize variables zip code and city with bing map get location by point

hi @v-bacao-msft,

thank you for your answer,

I still have the zip code in the var, How could I remove it?

kind regards

Community Support Team
Community Support Team

Re: initialize variables zip code and city with bing map get location by point

 

Hi @Kesh ,

 

Please give an example of what values you need.

 

Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Kesh
Level: Powered On

Re: initialize variables zip code and city with bing map get location by point

for example, for the latitude : 48.85837 and longitude :2.294481 (eiffel tower)

the result of your expression is "75007 Paris" and I don't need the "75007 ". How could I remove that?

kind regards.





Community Support Team
Community Support Team

Re: initialize variables zip code and city with bing map get location by point

 

Try this expression:

trim(replace(trim(split(body('Get_location_by_point')?['name'],',')[1]),body('Get_location_by_point')?['address']?['postalCode'],''))

Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Kesh
Level: Powered On

Re: initialize variables zip code and city with bing map get location by point

Thank you it works!!

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 87 members 5,310 guests
Recent signins:
Please welcome our newest community members: