Variable being passed to menu for prompt but could be audio or TTS

Hi guys

My need here is that I want to pass a variable name to an Architect menu for specifying the prompt. The issue is that I'm giving users the option to either use TTS for the menu, or a User Prompt. I'm trying to work out how to build the expression within Architect to handle this. I'm assuming I'll need to build some IF{...} string in there but has anyone done this and got it working? At a high level it would be something like, if the variable starts TTS then the remainder of that variable would be the text to play out. If it doesn't start TTS then it would just look up and play that variable as a normal user prompt.

Let's say the variable is named Flow.thingToPlay and the value indicates if it is TTS by starting with "tts:". So if it's tts it will look like "tts:hello there" and if it's a prompt name it will look like "myHelloPrompt"

Use this expression:

If(Length(Flow.thingToPlay) >= 4 AND AreEqual(Left(Flow.thingToPlay, 4), "tts:"),
ToAudioTTS(Right(Flow.thingToPlay, Length(Flow.thingToPlay)-4)),
ToAudio(FindUserPrompt(Flow.thingToPlay)))

Thanks Melissa, haven't testing yet but that looks like it'd work fine.