Map output from Google Maps address validation

I have av incoming Webhook with data from our Booking-system, wich created a customer in our accounting-system, creates a contact - and sends the updated ID and information back to our Booking-system.

One of these steps is to validate the address, into a format that our accounting-system can handle.

From the GoogleMaps module i get these 2 “outputs”. I have tried all possible things i can think of to map these fields, but not succeded. I can map them directly, but as you can see, there are different numbers for different fields / address info - and not in the same place every time.

For example i need to map “Long Name”, with correct country as value.


Here are some example of the outputs as text:

Welcome to the Make community!

Please provide the output bundles of the modules by running the scenario, then click the white speech bubble on the top-right of each module and select “Download output bundles”.
Screenshot_2023-10-06_141025

A.

Save the bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.
Uploading it here will look like this:

bundle.txt (12.3 KB)

B.

If you are unable to upload files on this forum, alternatively you can paste the formatted output bundle in this manner:

  • Either add three backticks ``` before and after the code, like this:

    ```
    input/output bundle content goes here
    ```

  • Or use the format code button in the editor:
    Screenshot_2023-10-02_191027

Providing the output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

This will allow others to better assist you. Thanks!

2 Likes

Here are some example of the outputs as text:

1 Like

You can use a “Set variable” with the built-in function toCollection

{{toCollection(22.address_components; "types.1"; "long_name")}}

This will create a variable that has mappable collection properties:

Screenshot_2024-01-17_100135
Screenshot_2024-01-17_100126
Screenshot_2024-01-17_100121

As there will be addresses with more properties than others, as seen above, what you can do is use the built-in function ifempty to return an {{emptystring}} if the property/variable doesn’t exist:

Here is an example

Screenshot_2024-01-17_100113 (2)

2 Likes