cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kevin00
Helper II
Helper II

Unable to reference "inputs" "parameters"

 

[
  {
    "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?

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User
Super User

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.

 

 

 

example.png

 

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 😁



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


View solution in original post

6 REPLIES 6
alaabitar
Super User
Super User

Hello

 

Have you tried to use the parse json connector and then get the value from it ?

 

Best regards,

Alaa

Best regards,
Alaa


--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Expiscornovus
Super User
Super User

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']

 



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


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.

Expiscornovus
Super User
Super User

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.

 

 

 

example.png

 

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 😁



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


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?

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (3,072)