IF/Else statement not working

Hi I’m trying to use an If/Else statement to choose what model is used for my ElevenLabs API call.

Step 1: ID is returned from script module

Step 2: result from Step 1 is added to next module, http module, and if/else is within one of the fields to choose between ElevenLabs models based on the result of Step 1.

Here’s the result of step 2:

As you can see, the result from step 1 doesn’t match any of the values in the IF statement, but it didn’t use the else value for the model_id. I’m not sure what I’m doing wrong, this is my first time using the If/Else feature.

You can’t chain or this way.

You need to repeat the {{20.result.data = }} for each “or

if
  ID = "value1" OR
  ID = "value2" OR
  ID = "value3" OR
  ID = "value4" OR
  ID = "value5"

then
  do_something

else
  do_something_else
3 Likes

That fixed it. Thank you :sweat_smile:

1 Like

Hello @Jack_Randall

We are glad that your problem has been resolved by @samliew .Here is a screenshot of the solution
Screenshot 2024-02-07 123236

If you need any further assistance, feel free to contact us

GROWWSTACKS
Visit us

2 Likes

No problem, glad I could help!

1. If you have a new question in the future, please start a new thread. This makes it easier for others with the same problem to search for the answers to specific questions, and you are more likely to receive help since newer questions are monitored closely.

2. The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep the Community organized.

This marks the topic as solved, so that:

others can save time when catching up with the latest activity here, and

  • allows others to quickly jump to the solution if they come across the same problem

To do this, simply click the checkbox at the bottom of the post that answers your question:
Screenshot_2023-10-04_161049

3. Don’t forget to like and bookmark this topic so you can get back to it easily in future!

1 Like