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 : sQ+DuWwJj5t1j+w819V+Vv
Power Automate - Building Flows
Answered

Google maps API and JSON format

Like (0) ShareShare
ReportReport
Posted on 23 Sep 2020 07:34:27 by 167

Hi all,

 

I'm building a flow that sends an API request via HTTP GET to google's maps API in order to get a trip duration from one destination to another. 

 

Everything works so far, however when i get the response back  from google i get the JSON in a schema that doesn't seem to let me select the particular property that I'm after.

 

What I'm trying to isolate is the duration_in_traffic element from the JSON. Can anyone help me out with this? I've tried PARSE JSON without success.

 

Here is the output from the HTTP request:

 

{
  "destination_addresses": [
    "10 Walker St, Braeside VIC 3195, Australia"
  ],
  "origin_addresses": [
    "64 Cochranes Rd, Moorabbin VIC 3189, Australia"
  ],
  "rows": [
    {
      "elements": [
        {
          "distance": {
            "text""10.4 km",
            "value"10394
          },
          "duration": {
            "text""14 mins",
            "value"850
          },
          "duration_in_traffic": {
            "text""14 mins",
            "value"865
          },
          "status""OK"
        }
      ]
    }
  ],
  "status""OK"
}

 

How can i get the value of 14 mins?

 

Thanks.

  • luizbelo Profile Picture
    4 on 30 Dec 2021 at 14:11:31
    Re: Google maps API and JSON format

    Muito obrigado

  • asafweis Profile Picture
    167 on 24 Sep 2020 at 23:04:35
    Re: Google maps API and JSON format

    Thank you!

    Worked perfectly

  • Verified answer
    efialttes Profile Picture
    14,756 on 23 Sep 2020 at 07:41:45
    Re: Google maps API and JSON format

    Hi!

    I would try withthe following WDL expression

     

    first(first(body('HTTP')?['rows'])?['elements'])?['duration']?['text']

     

    Hope this helps

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

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2