[
{
"name": "Update_project_item_GUID_value",
"inputs": {
"host": {...},
"parameters": {
"dataset": "https://...",
"parameters/method": "PATCH",
"parameters/uri": "_api/web/lists/...",
"parameters/headers": {
"content-type": "application/json",
"IF-MATCH": "*"
},
"parameters/body": "{\n'ProjectGUID' : 'dfh-h345-kj3h'\n}\n\n"
},
}
}
]
I use body('ProjectGUID_Filter')[0]?['name'] which brings back the expected result, but when I use body('ProjectGUID_Filter')[0]?['inputs']?['parameters']?['parameters/body'] to try to get the ProjectGUID it comes up empty when there is a value there. I even tried body('ProjectGUID_Filter')[0]?['inputs']?['parameters']?['dataset'] just to see if I could pull anything out of parameters, but it was the same result. Can anyone see what I am doing wrong?
Solved! Go to Solution.
Hi @Kevin00,
The name of the function is actions, so plural.
Below is an example, if that helps.
In this example I have a HTTP action called 'ProjectGUID Filter'. I am using an expression in a Compose action to retrieve the value of the input body field of the previous HTTP action. In this example I used the projectguid field and it's value.
Btw, in this example I used a configure run after with the status has failed. The reason is this random body value is not allowed in this POST request against the short url of the Power Platform admin centre link, so the expected outcome is a has failed response 😁
Hello
Have you tried to use the parse json connector and then get the value from it ?
Best regards,
Alaa
Hi @Kevin00,
It looks like you want the input of an HTTP action, correct? That is not part of the body itself. Can you try the actions function instead of the body function?
Try this format:
actions('ProjectGUID_Filter')['inputs']['body']
Or try this format:
actions('ProjectGUID_Filter')['inputs']['parameters']['parameters/body']
After you parse JSON doesn't it require a loop in the output? This is already in a loop so I was trying to avoid nested loops.
Sorry, I am not able to post screen shots or code since it is on a totally separate system/network.
I am setting an object variable like this: objError = {
"name": "body('ProjectGUID_Filter')[0]?['name']",
"inputParam": "body('ProjectGUID_Filter')[0]?['inputs']?['parameters']?['parameters/body']"
}
When I try "action" I get an error "template function 'action' is not expected at this location". To be honest I am a little confused about action, body, outputs, result.... opps, just saw that 'result' returns input & outputs from actions inside a scoped action. I am setting this object variable inside a "catch" scope, so I guess that makes a difference.
Hi @Kevin00,
The name of the function is actions, so plural.
Below is an example, if that helps.
In this example I have a HTTP action called 'ProjectGUID Filter'. I am using an expression in a Compose action to retrieve the value of the input body field of the previous HTTP action. In this example I used the projectguid field and it's value.
Btw, in this example I used a configure run after with the status has failed. The reason is this random body value is not allowed in this POST request against the short url of the Power Platform admin centre link, so the expected outcome is a has failed response 😁
You were correct. Thank you for your help and I will mark yours as the solution. I have one other related question, Do you have a link or a resource that can explain when to use actions, body, outputs, result, or any other one I might be missing?
User | Count |
---|---|
16 | |
16 | |
14 | |
9 | |
8 |
User | Count |
---|---|
28 | |
27 | |
24 | |
23 | |
14 |