How to automatically copy postcode from custom field to standard location field
Asked by Mervyn Marsh:

We are importing job cards into trello, and importing the postcode for the job card (where the completed job will end up) into a custom field. Is there any way we can set up a rule to automatically copy the postcode from the custom field into the provided location field so that we can view each job card in map view?

Or is there an alternative work around to viewing all the job cards in map view without manually having to add the postcode to the location field of each card?


Answers:
author: Iain Dooley
body: [@Mervyn Marsh](/t5/user/viewprofilepage/user-id/4463869) as far as I'm aware there is no way to write to the pluginData of other powerups than your own, only to read from them.

comments: author: milynnus
body: [@Iain Dooley](/t5/user/viewprofilepage/user-id/1416112)

Picture is from Trello API documentation for Update a Card. It seems that something has changed

![Screen Shot 2021-07-05 at 7.26.18 AM.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/149987i135CA0BF7F944652/image-size/large?v=v2&px=999 "Screen Shot 2021-07-05 at 7.26.18 AM.jpg")


author: Iain Dooley
body: [@milynnus](/t5/user/viewprofilepage/user-id/3947182) neat!


author: milynnus
body: [@Iain Dooley](/t5/user/viewprofilepage/user-id/1416112)

Just managed to update the coordinates, address and locationName. The Map View changed on the card. Basically used the coordinates of New Location to replace the attributes on the test card...one with dummy address and name.![Screen Shot 2021-07-05 at 7.44.51 AM.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/149988i809D269A821A403D/image-size/large?v=v2&px=999 "Screen Shot 2021-07-05 at 7.44.51 AM.jpg")![Screen Shot 2021-07-05 at 7.44.36 AM.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/149989i5F408C6728BEE0A8/image-size/large?v=v2&px=999 "Screen Shot 2021-07-05 at 7.44.36 AM.jpg")


author: Mervyn Marsh
body: Thanks for this.

I'm not that tech savvy, but could you run through (ideally step by step) how we could create a butler rule to automate the process?

Currently we have a post code in a custom field box, and we would somehow like to create a Butler rule which could copy the the location information from the custom field into the pre-existing location field on trello that links to the Map view.

Trust that makes sense, and thanks again.


author: Mervyn Marsh
body: This is also for UK postcodes and addresses


author: milynnus
body: [@Mervyn Marsh](/t5/user/viewprofilepage/user-id/4463869)

This will require programming. Please leave me your contact via my profile page : website.


author: milynnus
body: **Endpoint will only be available for 24 hrs to minimise use of event quota.**

**More info here :<https://trello.com/c/TVe3Rf7V/51-update-card-location-information-using-geocoding-services>**

[@Mervyn Marsh](/t5/user/viewprofilepage/user-id/4463869) [@Hariii Umaiii](/t5/user/viewprofilepage/user-id/4463871)

Here's the endpoint you can call using Butler Http Request

URL is <https://60389.wayscript.io/coordinates?country=UK>

Payload for testing is

{  
"card_id": "",  
"street": "",  
"city": "",  
"state": "",  
"zip": "GU50BD",  
"display_address": "",  
"display_locationName": ""  
},

#### It will return {httpresponse.latitude} and {httpresponse.longitude} {#toc-hId--539843288}

The update to the card to show on Map View will need your Trello credentials. The endpoint will eventually be password protected. It is currently not activated hence it will just return the coordinates.

For USA it will be

URL is <https://60389.wayscript.io/coordinates?country=USA>

Payload for testing is

{  
"card_id": "",  
"street": "60 Lincoln Center Plaza",  
"city": "",  
"state": "",  
"zip": "10023",  
"display_address": "",  
"display_locationName": ""  
},


author: milynnus
body: [@Mervyn Marsh](/t5/user/viewprofilepage/user-id/4463869) [@Hariii Umaiii](/t5/user/viewprofilepage/user-id/4463871)

Some time back I (think) wrote a program that update the location with Map Power Up installed, the map does not show on the card. Not sure whether that has changed recently.

comments: author: milynnus
body: [@Mervyn Marsh](/t5/user/viewprofilepage/user-id/4463869) [@Hariii Umaiii](/t5/user/viewprofilepage/user-id/4463871)

Given my test just now (see my reply to [@Iain Dooley](/t5/user/viewprofilepage/user-id/1416112) ) you should be able to import locations with address, locationName and the coordinates. You need to translate the postal code to the above. If it is a matter of creating new cards it will be a lot easier. To update an existing card then you need the cross reference.


author: milynnus
body: [@Mervyn Marsh](/t5/user/viewprofilepage/user-id/4463869) [@Hariii Umaiii](/t5/user/viewprofilepage/user-id/4463871)

Update: used free USA census geocoding website to get coordinates and update a card - address, locationName and coordinates.