how to compare a smart value variable?

ben friedman December 2, 2021

Hi,

the use case is that an API calls come via an incoming web hook.

for security, it contains a key as an identifier. im parsing the key value into an automation variable, then i make a comparison, but i cant get it to work. it passes even if the key passed into the value is not the expected key.

in the image below, the first line of the log shows the incoming webhook data. the second line shows the extracted key. the left panel shows that its the APIkey variable that is printed in the 2nd line of the log, followed by the comparison.

compare.png

 

this are the details of the comparison

comparison.png

1 answer

0 votes
Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 3, 2021

What is "passing" in your If rule? That is to say, what action are you trying to gate? What is the THEN to go with your IF?

I wonder if maybe your If rule is flipped the wrong way, and you meant to do:

Screen Shot 2021-12-03 at 11.02.32 AM.png

Also, if you're trying to match exact text, you should use "equals", not "exactly matches regular expression"

It also might help if you can explain the bigger picture of what you're trying to do.

Suggest an answer

Log in or Sign up to answer