cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BadariPrasad
New Member

"When a HTTP request is received"-Unable to get array of values sent as parameter in URL

Hi, I am a newbie on Power Automate. I have created a flow which should receive an array of values for "name" and "mobile" as parameters in the http request.

BadariPrasad_1-1596100490732.png

 

The HTTP GET URL is "https://prod-18.southeastasia.logic.azure.com:443/workflows/7e082f2ea3ae4862aba63c854116c4dd/trigger..."

 

When I use any of the following requests the OUTPUT shows NULL and does not show the parameter values sent.

 

https://prod-18.southeastasia.logic.azure.com:443/workflows/7e082f2ea3ae4862aba63c854116c4dd/trigger...

 

https://prod-18.southeastasia.logic.azure.com:443/workflows/7e082f2ea3ae4862aba63c854116c4dd/trigger...

 

https://prod-18.southeastasia.logic.azure.com:443/workflows/7e082f2ea3ae4862aba63c854116c4dd/trigger...

 

What am I doing wrong? How to I get the array of values from the parameters?

1 ACCEPTED SOLUTION

Accepted Solutions
JohnAageAnderse
Memorable Member
Memorable Member

Hello @BadariPrasad 

The URL query parameters that you provide to the Flow will end up in the "queries" property.

Use the expression "triggerOutputs()?['queries']" to see your parameters.

 

Your parameters "name[1]" and "name[2]" will end up as "triggerOutputs()?['queries']?['name[1]']" and "triggerOutputs()?['queries']?['name[1]']" respectively.

 

Give it a try 🙂

Kind regards, John

View solution in original post

8 REPLIES 8
JohnAageAnderse
Memorable Member
Memorable Member

Hello @BadariPrasad 

The URL query parameters that you provide to the Flow will end up in the "queries" property.

Use the expression "triggerOutputs()?['queries']" to see your parameters.

 

Your parameters "name[1]" and "name[2]" will end up as "triggerOutputs()?['queries']?['name[1]']" and "triggerOutputs()?['queries']?['name[1]']" respectively.

 

Give it a try 🙂

Kind regards, John

View solution in original post

Thanks a lot @JohnAageAnders for the pointer which led me to resolve it. I improved it a bit more by changing to HTTP POST using JSON in the body. 

 

 

 

pauldeden
Advocate I
Advocate I

I'm getting this error when following the accepted solution.

 

'The template language expression 'triggerOutputs()['queries']['event_id']' cannot be evaluated because property 'queries' doesn't exist, available properties are 'headers'. Please see https://aka.ms/logicexpressions for usage details.'.

Hello @pauldeden 

Please provide more information! Are your HTTP request using the GET method?

To see all information available from your trigger, use a Compose action and add the expression "triggerOutputs()" in it, then run and see what you can see!

Kind regards, John

Hi @JohnAageAnderse, I was using the DELETE HTTP method and trying to use query parameters because I got another error when trying to provide data via the request body.

 

I decided to change the method to POST and submit the item id to delete via the request body, but it would be more appropriate if I could provide the item id to delete to the endpoint using the DELETE method.

 

Thank you,

 

Paul

Hello @pauldeden 

I just created a test flow that receives a DELETE request with 3 parameters (added at the end as "...Po6Xc&ID1=1&ID2=2&ID3=3") and the result shows that the parameters are in the "queries" attribute of the request - shown below.

{
  "name""manual",
  "inputs": {
    "schema": {},
    "method""DELETE"
  },
  "outputs": {
    "headers": {
      "Accept""*/*",
      "Accept-Encoding""deflate,gzip",
      "Host""prod-138.westeurope.logic.azure.com",
      "User-Agent""Mozilla/5.0,(Windows NT 10.0; Win64; x64),AppleWebKit/537.36,(KHTML, like Gecko),Chrome/92.0.4515.131,Safari/537.36",
      "X-Real-IP""78.84.194.86",
      "Content-Length""0"
    },
    "queries": {
      "ID1""1",
      "ID2""2",
      "ID3""3"
    }
  },
  "startTime""2021-08-04T04:59:28.8937735Z",
  "endTime""2021-08-04T04:59:28.8937735Z",
[snip]
  "status""Succeeded"
}
 
Is that something similar to what you wanted?
Kind regards, John

Yes, thank you, @JohnAageAnderse! I'll try again and see if the previous problems were my own doing and report back.

Not surprisingly, @JohnAageAnderse, you were right. I tested it and the expression "triggerOutputs()['queries']['test1']" on a cloud flow whose trigger is "When a HTTP request is received" configured for the DELETE HTTP method where I added a 'test1=value1' query param to the HTTP request URL gave me the value 'value1'.

 

Thank you for helping me correct my mistake. I'm happy the DELETE method accepts query params, and we developers have access to those query params in our flows.

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

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