Allow {name} to accept variables

To allow dynamic naming to reuse snippets and avoid conflict.

I've asked for help about this in the here Questions and Help section but turns out it's not possible, hence the request. :slight_smile:

Items: {formtext: name=itemName1}
Price: {formtext: name=itemPrice1}
{formtoggle: name=add item(s); default=no}{note}{formtext: name=numLines; default=1}{if: numLines<1}{error: Should be >=1; block=yes}{endif}{endnote}
{repeat: for i in seq(1,numlines,1)}
Line {=i+1}:
Items: {formtext: name=itemName}
Price: {formtext: name=itemPrice}
{endrepeat}{endformtoggle}

Ideally I would like it to look like this:

Items: {formtext: name=itemName}
Price: {formtext: name=itemPrice}
{formtoggle: name=add item(s); default=no}{note}{formtext: name=numLines; default=1}{if: numLines<1}{error: Should be >=1; block=yes}{endif}{endnote}
{repeat: for i in seq(1,numlines,1)}
Line {=i+1}:
Items: {formtext: name=itemName{=i}}
Price: {formtext: name=itemPrice{=i}}
{endrepeat}{endformtoggle}

Hi @latetotheparty , when you mention:

The conflict of which variables are you trying to avoid? For example, check out this snippet:

The most popular color is {formtext: name=popular; default=blue}

{repeat: for name in ["Jack", "Bob"]}
{=name} likes the color {formtext: name=color}. The color {formtext: name=color} is {="not" if popular <> color else ""} the same as the most popular color: {formtext: name=popular}.
{endrepeat}

As you can try in the preview, the value of the color for Jack can be inputted independently of the value of the color chosen for Bob.