Create a dropdown list from text fields previously filled in

I'm looking to populate potential statements between 2 clients without the need to repeat inputs.

I was thinking Name 1 = text field 1, Name 2 = text field 2

Then a multi response dropdown that lets me lead a sentence with Name 1/ Name 2/ Name 1 and Name 2.

As below but filling in the client name rather than having locked dropdown options. Client 2 may not always be included hence why I have it behind the tick box.

{formtext: name=Name}{formtoggle: name=Client 2; default=no} & {formtext: name=Client 2 name}{endformtoggle}

{formmenu: Client 1 name; default=Client 2 name; multiple=yes; formatter=items -> join(items, "BLAZE_AND")}

Does this work for you?

{formtext: name=Name}{formtoggle: name=Client 2; default=no} & {formtext: name=Client 2 name}{endformtoggle}
{list=[Name, `Client 2 name`]}

{formmenu: multiple=yes; formatter=items -> join(items, "BLAZE_AND"); values={=list}; name=aaa}

Yeah that looks great thanks. Is there a way to populate client 1 as ticked by default?

You could try the approach below:

{formtext: name=Name}{formtoggle: name=Client 2; default=no} & {formtext: name=Client 2 name}{endformtoggle}
{list=[Name, `Client 2 name`]}

{formmenu: name=selected; multiple=yes; values={=list}}
{if: selected <> [Name] and selected <> [`Client 2 name`] and selected <> [Name, `Client 2 name`] and Name <> ""}{selected=[Name]}{endif}

This will by default pick first option when there is nothing selected.

There might be small inconvenience due to approach for default selection. To select only option two you need to select both and unselect option 1. You can't unselect option 1, because that will lead to empty selection which will automatically lead to selection of option 1 again.

1 Like

Thanks for the help. Does having a default name I cannot have the 'and' in between client 1 and client 2 if they are both selected?

You can, added the formatter back

{formtext: name=Name}{formtoggle: name=Client 2; default=no} & {formtext: name=Client 2 name}{endformtoggle}
{list=[Name, `Client 2 name`]}

{formmenu: name=selected; multiple=yes; values={=list}; formatter=items -> join(items, "BLAZE_AND")}
{if: selected <> [Name] and selected <> [`Client 2 name`] and selected <> [Name, `Client 2 name`] and Name <> ""}{selected=[Name]}{endif}

1 Like

Amazing, thank you