How to reduce the number of IF statements defined in the UI script custom action

Hello,

In the custom action of the script, I need to define more than 100 IF statements.
For example, the steps would be as follows:
[
IF ( boolean1 == true ){text == "text1"};
IF ( boolean2 == true ){text == "text2"};
...
IF ( boolean99 == true ){text == "text99"};
IF ( boolean100 == true ){text == "text100"};
]
It takes a lot of time for users to define each IF statement one by one, and it is also prone to errors.
Is there a way to reduce the number of IF statements and simplify the structure?
(It would be helpful if I could use something like JavaScript bracket notation.)

Best regards,
Hirofumi Enotani

Could you handle that logic in a dynamic string variable instead?

ifElse(boolean1,"test1",ifElse(boolean2,"test2",ifElse....))))..

Though I understand dynamic variables might have some limitations as well.

Certainly Scripter feels like it is well overdue for a bit of a redesign, UI for adding, moving, editing stacks feels outdated. Custom Actions would be nice be able to some more complex things like this naturally.

1 Like

Hi,

I'm sorry for the late reply. Thank you for your response.
I will test it based on your advice.

Best regards,
Hirofumi Enotani

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.