You are viewing limited content. For full access, please sign in.

Question

Question

Best method for multiple if calculations (15+)

asked on May 16, 2024

Hi all, 

 

Just wanted to know what was the best method on forms for multiple if statements. Sure I can do nested statements, but when there are 15+ conditions I'm working with I wondered if there was a better way.

I looked up the Switch function in Javascript however I don't think it works with the modern designer Javascript due to limitations.

Bascially I wanted the form to do things based on what the users domain was.

 

Thanks

 

 

0 0

Answer

SELECTED ANSWER
replied on May 16, 2024

You could use 15 IF statements or a switch (almost the same concept), but a lookup to a simple table would be the better approach.

Relational tables are made just for this reason. I can have a column for domain and a column for things to do. Now I can say give me the thing to do when domain = X.

1 0

Replies

replied on May 16, 2024

Are you trying to use rules for showing/hiding based upon a field? If so, I would create 15 hidden fields, and put one IF statement on each. That way, you can easily create rules based upon each corresponding field. Makes it easier to understand and makes the formulas much easier to write IMO

1 0
replied on May 16, 2024

Thanks all! I think I'll go with a lookup for the bigger ones, but I like your idea Kevin for like under 10 options, I think its much easier to read and understand. 

 

Appreciate the info

Thank you

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.