BUG? (request.formparam.names) and (request.formparam.count) Not Working?!?

Not applicable

Hello All,

Does anyone else have this issue? In my JavaScript callout, I have the following three lines:

print("request.formparam.names: " + context.getVariable("request.formparam.names")); print(" request.formparam.bobo: " + context.getVariable("request.formparam.bobo")); print("request.formparam.count: " + context.getVariable("request.formparam.count"));

I am using POSTMAN and created a POST request where the only form parameter "bobo" is set to the value of "steve". When I run this through Apigee and watch the debugger, I get:

request.formparam.names: null request.formparam.bobo: steve request.formparam.count: null

"request.formparam.names" should be "[bobo]", request.formparam.count should be "1". Is anyone else experiencing this issue, or am I going crazy?

TIA, Steve

Solved Solved
2 7 741
1 ACCEPTED SOLUTION

ah, its a doc bug, the correct variable name is 'request.formparams.names' and 'request.formparams.count'

and for accessing individual variables you would use request.formparam.{paramname}

Thanks for reporting @Stephan.Cossette

fyi, @Floyd Jones

View solution in original post

7 REPLIES 7

Not applicable

Hi Anil,

Thanks for the quick response, but I think you may be confused on the usage of these variables...

  • "request.formparam.names" is a built in variable to Apigee that is supposed to return an array of all of the form parameter names.
  • "request.formparam.count" is a built in variable to Apigee that is supposed to return the number/count of all of the distinct form parameters.

You can refer to "http://apigee.com/docs/api-services/reference/vari..." for these built ins... but this one should function like "request.header.names" & "request.header.count" and "request.queryparam.names" & "request.queryparams.count" -- these other two similar references *work correctly*.

You are explicitly assigning these values and that defeats the purpose of the built-ins.

I did however change the header "Content-Type : application/x-www-form-urlencoded", and it is still not working.

Thanks! Steve

@Stephan.Cossette

Ahhh, I got it now... Yes, It seems like a bug. I can able to reproduce same. Great finding. We will let respective team know about this issue. We will keep you updated on same.

ah, its a doc bug, the correct variable name is 'request.formparams.names' and 'request.formparams.count'

and for accessing individual variables you would use request.formparam.{paramname}

Thanks for reporting @Stephan.Cossette

fyi, @Floyd Jones

Docs updated. Thanks!

Awesome, Thank you @Floyd Jones

Not applicable

Hello Anil ,

Any Update on the Above issue...??

the correct variable name is 'request.formparams.names' and 'request.formparams.count'