cancel
Showing results for 
Search instead for 
Did you mean: 

Flow Builder not reading conditions at runtime

grohitg238
Participant
0 Kudos
327

Hello Experts,

We are using flow builder in one of the progressive profiling feature, where phone number is captured and verified. so the flow is,

  1. Start
  2. Condition to check if phone number is available on user account(!account.phoneNumber).
  3. Display form with phone widget to verify the phone number.
  4. Condition to check if verified phone number is added or not(account.phoneNumber)
  5. display sms preference capture custom screen.
  6. end flow

We are facing issue at step 4 where condition (account.phoneNumber) is always flowing to "false" even after verification of phone number at step 3.

Are these conditions pre-loaded when we trigger the flow?

your thoughts are much appreciated.

Thanks
Rohit

View Entire Topic
samuelyang
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi @grohitg238 Rohit, I verified the same on my end, and it worked fine. 

I was using the below JS expression to test if the phoneNumber exists. 

samuelyang_0-1720397684811.png

If the step 4 is not working, how about the step 2? Could you please share your JS expression? 

grohitg238
Participant
0 Kudos

Thanks Samuel,

grohitg238_0-1720409558317.png

I'm using only "account.phoneNumber" as condition to check value if exists, and "! account.phoneNumber"  to check if value doesn't exists.
similar we use in JavaScript code to check if data exists or not. 

There can be any value other than Null e.g.' ',undefined,false,0,NaN can be  stored for a field, hence did not add only null check.

This is working,

account.phoneNumber !== null && account.phoneNumber !== undefined && account.phoneNumber !== NaN && account.phoneNumber !== '' && account.phoneNumber !== 0 && account.phoneNumber !== false


Thanks

Rohit

 

samuelyang
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Rohit, If step 2 worked, and you only wanted to check if the phoneNumber is verified by the user, then on step 4 you should only need to check the verified fields, eg. isVerified, verified, or verifiedTimestamp, right?
grohitg238
Participant

Hi Samuel,

We have email verification process already in place at the time of registration, hence isVerified, verified, or verifiedTimestamp these attributes are already set with values for the user. We are not able to differentiate phone verification flags using above attributes. We tried with custom data field for phone number verification status, it works.

Thanks

Rohit

samuelyang
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Rohit, You're right, the verified fields are reused by both email and phone number fields. Good to know now it worked for you by using custom data fields 🙂