Yes looks better now and you also have no error anymore. Hope you have found answer for your original question.
Original Message:
Sent: 10-22-2025 03:50
From: Neil Jones
Subject: Nested 'if' Statement
Thanks you.
Believe this is now correct...
If(Flow.bcpEmergencyGroupStatus=="false", If(Flow.chosenLanguage==Task.promptLanguageD, ToAudioTTS(Task.callbackOffer), If(Flow.chosenLanguage==Task.promptLanguageL1, ToAudioTTS(Task.callbackOfferL1), If(Flow.chosenLanguage==Task.promptLanguageL2, ToAudioTTS(Task.callbackOfferL2), ToAudioTTS(Task.callbackOffer)))), ToAudio(FindUserPrompt("Novasol_CallbackOffer")))

------------------------------
Neil Jones
Voice Comms Lead
Awaze Uk
neil.jones@awaze.com
Original Message:
Sent: 10-22-2025 03:21
From: Vineet Kakroo
Subject: Nested 'if' Statement
Hi @Neil Jones,
I think your IF statement is not complete as you are missing the ELSE part. The Architect IF statement is like IF(statement true, then do this, else do this), but I can't see the else part on the very first IF statement;
If(Flow.bcpEmergencyGroupStatus=="false",
If(Flow.chosenLanguage==Task.promptLanguageD,
ToAudioTTS(Task.callbackOffer),
If(Flow.chosenLanguage==Task.promptLanguageL1,
ToAudioTTS(Task.callbackOfferL1),
If(Flow.chosenLanguage==Task.promptLanguageL2,
ToAudioTTS(Task.callbackOfferL2),
ToAudio(FindUserPrompt("brand_CallbackOffer"))
)
)
)
)
In the above there is no ELSE for the first IF. I have marked the missing part of the code in RED.
If(Flow.bcpEmergencyGroupStatus=="false",
(
If(Flow.chosenLanguage==Task.promptLanguageD,
ToAudioTTS(Task.callbackOffer),
If(Flow.chosenLanguage==Task.promptLanguageL1,
ToAudioTTS(Task.callbackOfferL1),
If(Flow.chosenLanguage==Task.promptLanguageL2,
ToAudioTTS(Task.callbackOfferL2),
ToAudio(FindUserPrompt("brand_CallbackOffer"))
)
)
)
),
(
THIS IS THE ELSE PART FOR FIRST IF
)
)
------------------------------
Vineet Kakroo
Senior Technical Consultant
Original Message:
Sent: 10-21-2025 09:14
From: Neil Jones
Subject: Nested 'if' Statement
Thanks for the quick response - appreciated.
My statement my be incorrect, but if both variables are 'true' then the TTS prompt should be used, but if neither are 'true', i.e. false then the .wav file is to be played.
Hope this helps.
Thanks,
------------------------------
Neil Jones
Voice Comms Lead
Awaze Uk
neil.jones@awaze.com
Original Message:
Sent: 10-21-2025 08:26
From: Paul Simpson
Subject: Nested 'if' Statement
Hi Neil,
There is no reason why you can't. Some observations / questions though...
- What do you want to happen if Flow.bcpEmergencyGroupStatusis true? I think you're missing part of the statement? Or do you only want to use TTS_Prompt_File is Flow.bcpEmergencyGroupStatus==false is false AND chosenLanguage=="en"?
- I'm not a fan of reverse logic like this. It makes it harder to wrap your head around what's happening.
- Assuming Flow.bcpEmergencyGroupStatus==false is a boolean, you don't need the "==false"(if you reverse your logic 😉)
------------------------------
Paul Simpson
Views expressed are my own and do not necessarily reflect those of my employer.
Original Message:
Sent: 10-21-2025 04:13
From: Neil Jones
Subject: Nested 'if' Statement
Hi,
Need help with a nested 'if' statement.
I'm attempting to use two different variables to define which audio / tts prompt to announce. The following works perfectly:
(If(Flow.bcpEmergencyGroupStatus==false, ToAudio(FindUserPrompt("TTS_Prompt_File"), ToAudio(FindUserPrompt(".Wav_Prompt_File")))
but I'd like to add in another variable to the statement, i.e. using two values to determine which audio to use - example statement:
If(Flow.bcpEmergencyGroupStatus==false, If(Flow.chosenLanguage=="en", ToAudio(FindUserPrompt("TTS_Prompt_File"), ToAudio(FindUserPrompt(".Wav_Prompt_File"))))
and I'm not sure if my statement is incorrect or if it's not possible to use two variables within a 'if' statement against the 'play audio' node.
Thanks,
#Unsure/Other
------------------------------
Neil Jones
Voice Comms Lead
Awaze Uk
neil.jones@awaze.com
------------------------------