set a form variable value based on if statement results


Badge +8

Good Day,

 

I have a form variable account number; and want to set the account number to a value based on an if statement. 

For example:

 

If (submitted date != '')

{

account number = "string of values"

}

 

Is that possible?

 

Thank you,

Jennifer


6 replies

Badge +11

Try this:

place this formula in Account number field:

=if(submittedDate!="","String Of Values","Something else")

Badge +8

Thank you so much for the quick reply! This was exactly what I was looking for.  Do i need to do something specific with it other then put it in the default value field?

I am getting this in the field when the form loads:

81c6d6fb-9528-47fc-820b-da3f3a13e983} != "", {Control:498bc2d9-c2f5-496a-9a3b-daaaab390d8b}, "N/A")

Thanks again!

Jennifer

Badge +11

Do not put this in the default value. Use a caculated field and add this formula there. Once added, use Connected To and select the Account number field. If the controls are on the form, then you can use Named Controls else select the field from Item properties. Hope that helps.

Badge +8

Works perfectly! Thank you so much!

Userlevel 3
Badge +8

This is great! Now, How would you set a value if two of the choices are selected?

I have this formula it the user chooses "Phone" from the radio buttons: =if(WorkReqMO!="Phone","","13.85")

I'm trying this if they select Phone and Corporate Email: =if(WorkReqMO!="Phone" && "Corporate Email","","32.31")

The second one isn't working. How do I write an and?

Thanks

Kassie

Badge +11

Try this:

=if(AND(WorkReqMO!="Phone",WorkReqMO!="CorporateEmail"),"","32.31")

OR

=if(WorkReqMO!="Phone" && WorkReqMO!="CorporateEmail","","32.31")

Reply