web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Extracting Data from a...
Power Automate
Unanswered

Extracting Data from an API Response

(0) ShareShare
ReportReport
Posted on by
Hiya,
 
I have an API response from a timesheet system. I want to extract the Timesheet ID and corresponding Period End Date that it relates to and save this down as a variable to use in the next step of the automation.
 
I am new to Power Automate and have been trying to do this using ChatGPT which is just annoying me after providing a large number of inconsistent suggestions.
 
Can anyone suggest a solution please?
 
Many thanks
 
Categories:
I have the same question (0)
  • Mark Nanneman Profile Picture
    991 Super User 2025 Season 2 on at
    The best way to get started is to set up a simple flow that makes your API call to your timesheet system and look at the data it receives.  Does it return one object or an array of objects?
     
    You can do this by running the flow, and then opening the flow run and slecting the action that makes the API call, and click to view the output.
     
    For example, here I'll inspect the outputs of a sharepoint action.
     
    Click on a test run in the flow log:
    Click on the API action, here I'm selecting the "Get items" action.
     
     
    Most of the time, the output is something like the following.  a value property that has an array of JSON objects with the column names and value pairs.
    {
      "body": {
        "value": [
          {
            "id": 1,
            "title": "record1"
          },
          {
            "id": 2,
            "title": "record2"
          }
        ]
      }
    }
    Here's a real example of a SharePoint Get Items action output:
     
    How you work with the data depends on its structure and what you want to do.  You can Select the properties you want with a Select action to make a smaller array, or to rename the column names, or to combine values from multiple columns into a new one.  Or you can use a loop to loop through the array and do what you need to do with each based on conditional logic. 

    For example I could do an "Apply to Each" loop on "body/value" and reference each "ID" in the loop by typing "item()?['id']" in an expression.
    To store it in a variable, you'd just have to add an action to do that in the loop.
     
    Hope that helps, let us know if you have more specific questions.
     
     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard