cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ALFRED05
Helper III
Helper III

PARSE JSON GET_ITEM TO USE INDIVIDUALLY

Hi there,

In the image below is a GET ITEMS action that is retrieving 2 ROWS from a sharepoint list.

getitem.PNG

I need to extract each value of the 2 ROWS to create a SINGLE ROW like this

Captura.PNG

I though I had done it(pic below) but the schema failed, since I added manually a "2" to the second row column headers.

Capturadd.PNG

 

Any suggestion? thanks in advance!!

1 ACCEPTED SOLUTION

Accepted Solutions
efialttes
Super User III
Super User III

Hi!

I would use the following WDL expressions

first(body('Get_items')?['value'])

last(body('Get_items')?['value'])

First expression provides acces to your first item from 'Get items' output

Second expression provides acces to your last item from 'Get items' output

 

 

So if you need to show AMONT field value from item#1:

first(body('Get_items')?['value'])?['AMOUNT']

Same aproach for second item:

last(body('Get_items')?['value'])?['AMOUNT']

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

3 REPLIES 3
efialttes
Super User III
Super User III

Hi!

I would use the following WDL expressions

first(body('Get_items')?['value'])

last(body('Get_items')?['value'])

First expression provides acces to your first item from 'Get items' output

Second expression provides acces to your last item from 'Get items' output

 

 

So if you need to show AMONT field value from item#1:

first(body('Get_items')?['value'])?['AMOUNT']

Same aproach for second item:

last(body('Get_items')?['value'])?['AMOUNT']

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

thanks @efialttes! , that sound it will work. what if I have more than 2 items?

ALFRED05
Helper III
Helper III

never mind, I found it!

 

body('Get_items_2')?['Value']?[0]?['DESCRIPTION']
 
thanks!

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,680)