TTS Random from List

I’m looking for a way that I can utilize TTS but have it pull variables from a list randomly.

Right now I have it setup to just say single static messages.

Example:

Welcome Home PERSON

What I would like to do is have say something like:

Welcome Home PERSON, Your {VARIABLE 1} looks nice today.

variable 1:
- Shoes
- Face
- Shirt
- Other random insult

I’m sure it’s possible and I just haven’t spent enough time researching it yet.

There is an example of using templates for randomizing a response in the Alexa docs here - you should be able to adapt that to do what you want.

1 Like

Interesting, I’ll dig into that. Appreciated.

Also, with templates, you can do this:

{{ [“list item one”,“list item two”, “list item three”] | random }}

That’s pretty much what the link above says :slight_smile:

1 Like

Just different formatting. That threw me off the first time I saw the way that @ih8gates expressed it (in another thread) until I realized that though.

1 Like