Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.
Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Extracting variables from parameter query not working

I've copied and modified the sample code for extracting a variable from a query parameter:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ExtractVariables async="false" continueOnError="true" enabled="true" name="Extract-Variables-Query-Param">
    <DisplayName>Extract Variables - Query Param</DisplayName>
    <Source>request</Source>
    <QueryParam name="appt_number">
        <Pattern ignoreCase="true">{appt_number}</Pattern>
    </QueryParam>
    <VariablePrefix>queryinfo</VariablePrefix>
    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
</ExtractVariables>

And this is the URL itself:

http://myproxy.apigee.net/basepath/?appt_number=123

Unfortunately, the data "123" from the query param "appt_number" isn't being picked up. When I try and find the variable queryinfo.appt_number in a trace, it's empty:

5980-screen-shot-2017-11-22-at-110958.png

- all you see is the variable prefix.

As it's an almost verbatim copy of the sample, it should work - so what's missing?

Solved Solved
0 3 3,262
1 ACCEPTED SOLUTION

Not applicable

@kevinanderson

You must remove prefix variable to see your value in trace. Although it is not necessary to get query param value using extract variable. You can access it directly like request.queryparam.<param_name>

View solution in original post

3 REPLIES 3