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

location in newform not working?

Hi all,
Can it fit you can not add any address once you have created the field location in the sharepoint list. Can't add anything Does anyone have an answer?

See the picture
- Peter

15 REPLIES 15
Highlighted

Hi@phh,

Do you want to display a map for a given named location or address?

Because in previous communications I had assumed that you wanted to get the current location automatically, not taking into account that you were trying to manually enter the address and then identify it on a map.

What's more, it is not necessary that use lat/long values to locate. To make it easier, you just need to use a clear address. Here I just add a Text column named "TestAddress" to make a test for you.

If I understand correctly this time, you should try the following workaround.

>>Add the BingMaps connection within your app.

>>Get the API key.

>>Add an Image control and set the Image property as below:

 

"https://dev.virtualearth.net/REST/V1/Imagery/Map/Road/" & EncodeUrl(txtLocation.Text) & "?mapSize=" & txtImageWidth & "," & txtImageHeight & "&key="&txtBingMapsKey.Text

 

Note: The txtLocation represents the TexttInput where you enter the address. The txtImageWidth and txtImageHeight represent the TextInput control where you enter the height and width of the map. The txtBingMapsKey represents the TextInput control where you enter the API key.add.png

Best Regards,

Qi

 

Highlighted

Hi @v-qiaqi-msft,

I wanted to get the location/address  automatically. 🙂

I have my sharepoint liste with all my data and first I had tried to add the column in sharepoint called "Location". 
I think works like writing in Bing maps or google maps, but, but, but, I can not edit in the fields belonging to "location" in editform.
It's a big problem that I can not edit in the fields associated with "location" I'm just very unsure if a general test field will be able to do the same.
You had understood it really first. Would like all address data from my sharepoint list in a maps so I can see all the addresses on a maps.

Hope you understand 🙂

-Peter










 

Highlighted

Hi@phh,

Obviously, at the very first, I do understand your needs that you want to edit the Location column within PowerApps.


@phh wrote:

Hi @v-qiaqi-msft,

I wanted to get the location/address  automatically. 🙂

I have my sharepoint liste with all my data and first I had tried to add the column in sharepoint called "Location". 
I think works like writing in Bing maps or google maps, but, but, but, I can not edit in the fields belonging to "location" in editform.
It's a big problem that I can not edit in the fields associated with "location" 


Let me make it easy for you, Location column is read-only within PowerApps which means that you could not edit them in the corresponding data card within your Edit Form. The Location type column could not be edited and supported within PowerApps.

 


@phh wrote:

Hi @v-qiaqi-msft,
 I'm just very unsure if a general test field will be able to do the same.


Yes, as an alternative solution, general Text type columns could achieve your needs. 

The key is using URL.( Get a map with pushpins that does not specify a center point or map area)

I have a test on my side, please take a try as below.

Create a Text column to store every address as a formatted like this, "7595 Technology Way,Denver,CO80237". Other Text columns to store Latitude and Longitude. However, if you do not know the specific Latitude and Longitude, you can do some work on the Default property of the corresponding data card.

Set the Default property of the corresponding TextInput control to the Longitude data card as below:

 

BingMaps.GetLocationByAddress({addressLine:DataCardValue6.Text}).point.coordinates.longitude

 

Set the Default property of the corresponding TextInput control to the Latitude data card as below:

 

BingMaps.GetLocationByAddress({addressLine:DataCardValue6.Text}).point.coordinates.latitude

 

Note: DataCardValue6 represents the corresponding TextInput control to the Address data card.

Add an Image control and set the Image property as below:

 

"https://dev.virtualearth.net/REST/v1/Imagery/Map/Road?&" & Concat(
    AddColumns(
        TestLocate,
        "pp",
        "pp=" & Latitude & "," & Longitude & ";" & 21 & ";" & Title
    ),
    pp,
    "&"
)
& "&key=AskiLXdKpycN0Xdu-TXktMH_NrUEVzC7tysUv88d1-7n193t-tRhK-YQXkMjf1rI" /*” Aivzmzq……“ is my key*/

 

Note: 'TestLocate' is my SP list. 'Title' is my location name. The "pp" is a new column to store all the necessary data to display in the BingMap. You can check as below:

091001.png

091002.png

Best Regards,

Qi

Highlighted

Hi @v-qiaqi-msft,

Maybe we're close. i just get the same longitude and latitude though?
Can you help me with it?

See the picture

-Peter

Highlighted

Hi@phh,

Have you seen my complete solution? I have listed all the detailed steps.

Please give up using a Gallery to get the longitude and latitude values which will cause all the address to display the same longitude and latitude.

You should create 2 columns to store longitude and latitude values within your SP list.

If you do not know how to save your longitude and latitude values to your SP list, please do follow the following steps.

>>Create 2 Text type columns named 'Longi' and 'Lati' within your SP list.

>>Create an App via your SP list

001.png

The app you created from your SP list has a pre-built setting that you can click an item within the Gallery and edit it in an EditForm.

Set the Default property as below:

 

BingMaps.GetLocationByAddress({addressLine:DataCardValue8.Text}).point.coordinates.latitude
BingMaps.GetLocationByAddress({addressLine:DataCardValue8.Text}).point.coordinates.longitude

 

Note: DataCardValue8 represents the Address.

Then you can click the submit button and you will do have a similar SP as below:

091001.png

>>Refresh your SP list within your App.

>>Now you need to add an Image control like this and set the Image property as below:

091402.png                                                                                                                          

 

 

 

 

"https://dev.virtualearth.net/REST/v1/Imagery/Map/Road?&" & Concat(
    AddColumns(
        YourSPlist,
        "pp",
        "pp=" & Lati & "," & Longi & ";" & 21 & ";" & YourAddressColumn
    ),
    pp,
    "&"
)
& "&key=AskiLXdKpycN0Xdu-TXktMH_NrUEVzC7tysUv88d1-7n193t-tRhK-YQXkMjf1rI" /*” Aivzmzq……“ is my key*/

 

Please do read my solution completely! Every step is important.

0914Gif11.gif

Best Regards,

Qi

View solution in original post

Highlighted

Hi @v-qiaqi-msft,

IT WORKS NOW!

I have one more question how do i make the map bigger? so I can see more

-PHH

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (3,586)