Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Is it possible to validate queryparam with no value using Apigee Conditional Statements in request uri ?

I would like to check whether a queryparam exist or not in request uri.

For example how can i validate a queryparam 'company' exists or not in below request uri using apigee conditional statement ?

http://www.example.com?name=anil&company

PS: One way is to use regular expression, other way is to use javascript policy.

Is it possible to validate this using variable and conditional operators ?

Cheers,

Anil Sagar

Solved Solved
0 9 5,960
1 ACCEPTED SOLUTION

@Anil Sagar - request.queryparam.company will give you null if query parameter's value is empty (perhaps a bug in the product).

However you will get the existence of the queryparam using request.queryparams.names. It will give you an array which contains [company]

View solution in original post

9 REPLIES 9