09-26-2024 06:26 AM - edited 09-26-2024 06:35 AM
Hi Team,
I want to play the multiple prompts based on the message code. So I used the if statement .
If value == "2" is True we need to play the prompt ID is wrong, value == "3" is True play the prompt otp is invalid. If it is a False go the next step.
How do I do that . Can you help.
Jijesh
09-26-2024 07:20 AM
09-29-2024 11:26 PM - edited 09-29-2024 11:28 PM
@david.macias sorry for the delayed response.
I created a prompt for each message and I am trying single if statement can able to achieve play the multiple prompt based on the message code. but I failed. After that I created multiple If statement and played the different prompts based on the message code.
09-30-2024 06:35 AM
I am not sure I follow what you're trying to do. If you're chaining multiple if statements you could use a a case step to make it easier. Additionally, why don't you just rename your prompts to be 02.wav, 07.wav, that way you play whatever is returned from the OTPSEND document.
david
09-30-2024 10:11 AM - edited 09-30-2024 10:59 AM
I agree with @david.macias that you’re somewhat unclear in what it is that you want to achieve and that you likely could do it much simpler by just playing the sound file with a play prompt step that plays the file named based on whatever is returned from the lookup in the OTPSEND document. That way you should not need to use any if checks for this at all as the play prompt step would directly use the value provided by the lookup in the JSON document, resulting in different sound files being played based upon this lookup.
10-02-2024 06:47 AM
If you are trying to play a different prompt based on the value of a single variable, try using the "Switch" step.
10-08-2024 12:11 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide