Hi, is there a way to get the value of these using expression like @{first(body('Get_all_referrals')?['value'])?['id']}? I just want to get the values without using "Apply to each" action to loop inside the array of an array.
Hi @MattWeston365 , how do i append an object to an array of type variable?
This is the schema of my variable Owner:
This my Append Action:
But this gives me an error.
Do you know something about it?
@MattWeston365 , Yupz, i've used that in the flow to check whether it's empty. Thanks, with the syntax you've shared, that gives me an understanding of how to access array. And I was able to modify the query expression in different ways. Thanks, this is really a big help.
Hi @linojr_asmolo you could build a number of checks in before hand to make sure that the values are there.
E.g. you could use an expression: length(body('Get_all_referrals')?['value'][0]?['customerProfile']['team']) to see if it's greater than 0 (a team is present).
Thanks. This one works. So, as long as the ['team'] in body('Get_all_referrals')?['value'][0]?['customerProfile']['team'][0]?['email'] is not empty.
Thanks. I haven't tested the expression due access limitation for now, hopefully later given permission but i managed to do the expression using the format you've given.
Is that format can be also used in in this flow? They have the same JSON schema.
I got this error:
InvalidTemplate. Unable to process template language expressions in action 'Set_variable_2' inputs at line '1' and column '2090': 'The template language expression 'body('Parse_JSON')?['value'][0]?['customerProfile']['team'][0]?['email']' cannot be evaluated because property 'value' cannot be selected. Array elements can only be selected using an integer index. Please see https://aka.ms/logicexpressions for usage details.'.
It should be something like this:
body('Get_all_referrals')?['value'][0]?['customerProfile']['team'][0]?['email']
Thanks for your reply. How can i achieve it with this. Thanks in advance.
You can use either the "first" expression, or what I prefer to do is identify the exact array index. E.g. if I wanted just the first item then I could do something like this:
items()?['items'][0]?['team'][0]?['properties'][0]?['email']