cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
akharns
Helper V
Helper V

Get Last

I have a number of reasons to retrieve a single record from Excel tables based on filters and sort (like getting the latest record with certain filters), so this will be a design pattern for me.  The simple Get Record does not have sort and filters, and I am having problems getting the specific data elements from the excel record any other way. 

 

My plan is to encapsulate the "List Rows Present in a Table" action in a flow with an HTTP trigger, to save some of the steps from having to be done in multiple contexts.  With this design, I can see the HTTP body and the data in it in the calling flow, but I have not found a way to access one field in that record.  Even if I store it in an object variable, I haven't found a way to access the fields in the object afterwards.

 

Suggestions?

 

1 ACCEPTED SOLUTION

Accepted Solutions
abm
Super User III
Super User III

Hi @akharns 

 

You need to use JSON Parser to extract the results from your HTTP JSON result sets.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

View solution in original post

4 REPLIES 4
v-litu-msft
Community Support
Community Support

Hi @akharns,

 

Could you share the run result of the HTTP call?

 

If you want to get the Last record, you can consider use the variable to hold the Last record, set it's default value as the first record.

Then use the Apply to each to compare current item from "List Rows Present in a Table" with the value of last variable, if it is greater than last variable, set the last variable as current item, if it is less than or equal to last variable, find the next item.

After the loop, the last variable will be the last record.

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I just realized I posted twice on this subject.  The other post is https://powerusers.microsoft.com/t5/Building-Flows/Excel-Get-Latest/m-p/394499#M44942

 

Here are details on my example:

 

My called flow does the following:

  • List Rows Present in a Table:   I'm calling this with Order By and Top Count = 1.  This successfully finds the latest record.
  • Within Apply to Each, I set a variable called ReturnRecord, from the Body of the Excel lookup step.  This successfully puts the target record in the variable.
  • In Response, I put my ReturnRecord variable as the body.

My calling flow does the following:

  • I use HTTP to call the called flow with POST.  This successfully retrieves the record from the called flow.
  • I set a variable from the body of the the HTTP step, and successfully capture the record.
  • Here is where the problem is.  I tried to use Compose to extract one field from the record, but I cannot find a syntax that will allow me to do that.
abm
Super User III
Super User III

Hi @akharns 

 

You need to use JSON Parser to extract the results from your HTTP JSON result sets.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

View solution in original post

Perfect.  That was the missing piece.  Thanks!

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Users online (39,987)