cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
abhinaybuiss
Helper I
Helper I

Get values from a JSon array

Hi,

 

Thank you for reading my post!

 

I am receiving a JSON collection from a PowerApp which always has only one record.

 

I have parsed the JSON array and now I have:

 

 

[
    {
        "LegalEntity": "xxx",
        "VendBankACStatus": 386070000,
        "crec8_bankid": "bbb",
        "crec8_vendorid": "vvv"
    }
]

 

 

When I try to use the values in the subsequent steps I get an error:

 

 

Unable to process template language expressions in action 'Start_and_wait_for_an_approval' inputs at line '1' and column '19734': 'The template language expression 'body('Parse_JSON')?['crec8_bankid']' cannot be evaluated because property 'crec8_bankid' cannot be selected. Array elements can only be selected using an integer index. Please see https://aka.ms/logicexpressions for usage details.'.

 

 

 

I tried to compose the array but not able to resolve some syntax issues.

 

Could you please suggest what needs to be done to access the only record and use its values?

 

Regards,

Abhinay

 

1 ACCEPTED SOLUTION

Accepted Solutions
DamoBird365
Community Champion
Community Champion

Hi @abhinaybuiss 

 

You will have to address the single object by integer of by using the first() expression.

 

body('Parse_JSON')??[0]?['crec8_bankid']

or

first(body('Parse_JSON'))?['crec8_bankid']

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

 

 

View solution in original post

1 REPLY 1
DamoBird365
Community Champion
Community Champion

Hi @abhinaybuiss 

 

You will have to address the single object by integer of by using the first() expression.

 

body('Parse_JSON')??[0]?['crec8_bankid']

or

first(body('Parse_JSON'))?['crec8_bankid']

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

 

 

View solution in original post

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

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.

Top Solution Authors
Top Kudoed Authors
Users online (2,430)