We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

How to check a variable is undefined

Questions and answers about Plum Fuse+

Moderators: admin, support

Post Reply
henry
Posts: 21
Joined: Tue Aug 01, 2017 1:11 pm

How to check a variable is undefined

Post by henry »

How to check a variable is undefined in compare variables module?
We tried the undefined, 'undefined' and '', all the choices do not works.
Any suggestions?

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: How to check a variable is undefined

Post by support »

The compare variables module interprets data as strings. If you wish to check for a undefined variable in Javascript, you will have to use the Evaluate JS module with code like:

Code: Select all

if ([variable] === undefined) { [variable] = 'undefined'; }
Then you can check the variable with the compare variables module, since you have changed its value to the string "undefined".

However, it is not good coding convention to intentionally send undefined variables, so we would recommend rethinking your application to not rely on undefined variables.

Post Reply