cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

how to get last row from odata filter result?

I have below records for example(there will be 500) and I want to get last row after compose. How do I get last row and particular column-"ID":1203

[{"@odata.etag":"\"1\"","ItemInternalId":"1202","testwf":null,"Title":"1186","Created":"2016-04-07T13:46:21Z","Modified":"2016-04-07T13:46:21Z","AssignTo":null,"ID":1202,"Author":{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser","Claims":"i:0#.f|membership|amitloh@xyz.com","DisplayName":"i:0#.f|membership|amitloh@xyz.com","Email":null,"Picture":null,"Department":null,"JobTitle":null},"Author#Claims":"i:0#.f|membership|amitloh@xyz.com","Editor":{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser","Claims":"i:0#.f|membership|amitloh@xyz.com","DisplayName":"i:0#.f|membership|amitloh@xyz.com","Email":null,"Picture":null,"Department":null,"JobTitle":null},"Editor#Claims":"i:0#.f|membership|amitloh@xyz.com"},{"@odata.etag":"\"1\"","ItemInternalId":"1203","Title":"1187","testwf":null,"Created":"2016-04-07T13:46:22Z","Modified":"2016-04-07T13:46:22Z","AssignTo":null,"ID":1203,"Author":{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser","Claims":"i:0#.f|membership|amit.lohogaonkar@alscg.com","DisplayName":"i:0#.f|membership|amitloh@xyz.com","Email":null,"Picture":null,"Department":null,"JobTitle":null},"Author#Claims":"i:0#.f|membership|amitloh@xyz.com","Editor":{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser","Claims":"i:0#.f|membership|amitloh@xyz.com","DisplayName":"i:0#.f|membership|amit@xyz.com","Email":null,"Picture":null,"Department":null,"JobTitle":null},"Editor#Claims":"i:0#.f|membership|amit@xyz.com},{"@

10 REPLIES 10
Community Support Team
Community Support Team

Re: how to get last row from odata filter result?

Hi @AmitLoh-Powerap,

 

Assuming this is the outputs from Compose action, we could get the last record with another compose action, using the code below:

"@last(outputs('Compose'))"

last function would return the last element in the array or string passed in.

For the particular column ID, currently I have no idea to filter from the outputs of the compose, but we could add an apply to each to filter the data directly. 

Regards

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

Re: how to get last row from odata filter result?

Thanks!! that worked with single quotes-

'@last(@{outputs('Compose')})'

 

Now I need a value from particular column...

Re: how to get last row from odata filter result?

Hi,

 

There is one problem,the output of last is giving me all 5 rows.

Re: how to get last row from odata filter result?

Hi,

 

Can you create a working example with bringing 5 records from CDM and returning last row? 

Community Support Team
Community Support Team

Re: how to get last row from odata filter result?

See the screenshots:

77.PNG78.PNG79.PNG

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

Re: how to get last row from odata filter result?

I get belowtest.png

Re: how to get last row from odata filter result?

filter.png

Community Support Team
Community Support Team

Re: how to get last row from odata filter result?

80.PNG

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

Re: how to get last row from odata filter result?

thanks!!
Now I want column value from that last row for example Id

https://docs.microsoft.com/en-us/rest/api/logic/definition-language
"@parameters('myString')" Returns foo as a string.

mr-dang
Level 10

Re: how to get last row from odata filter result?

How do you reference a particular column in the last record you want?

 

"@last(outputs('Compose'))"
Microsoft Employee
@8bitclassroom

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Users Online
Currently online: 47 members 4,931 guests
Please welcome our newest community members: