Run a snippet from a button

Is it possible to run a snippet by clicking a button

Hi @tonydow,

Please check this post, especially ways 2 and 3 to insert your snippets with just a few clicks.

Thanks but I may not have made my querry clear. I want to create a {button} and use that to run a snippet

Hi @tonydow,

It would be great if you could provide an example or a use case.

I would like to try having a snippet with multiple buttons each running a unique snippet.

Hi @tonydow,

Would something like this work for your use case?

{run: selection = ""
}

{if: selection = ""}
Choose an option:
{button: selection = "greet"; label=Run Greeting Snippet}
{button: selection = "bye"; label=Run Farewell Snippet}
{button: selection = "info"; label=Run Info Snippet}
{else}

{if: selection = "greet"}
{import: /greet}
{elseif: selection = "bye"}
{import: /bye}
{elseif: selection = "info"}
{import: /info}
{endif}

{button: selection = ""; label={{^^%F0%9F%94%81^^}} Run another snippet
}

{endif}

Hello! This is the greeting snippet running.

Goodbye! This is the farewell snippet running.

Here is some information from the info snippet.

Yes, that's great. Thank you.