Search code examples
conditional-statementsapigee

How to determine if a value is a number in apigee


http://apigee.com/docs/api-services/reference/conditions-reference

in the condition reference of apigee, how can you determine if a value is a valid number

<Condition> (myNumber = %d)</Condition>
<Condition> (myNumber ~~ "d")</Condition>

tried both but it is still working, any idea?

Edit:

thank you for taking time and looking at my query,

I found out the answer, it is

(myNumber ~~ "\d")

~~ <- means that it will evaluate the regex, and the quotes will contain the regex.


Solution

  • Might be best to ask this in the Apigee Community (https://community.apigee.com). In that post, please clarify what you're expecting to see and what's actually happening. For starters, you'll want to be sure the myNumber variable is available in the message payload.