Having trouble with Formmenu

I am having this snippet wherein I am extracting details from clipboard from excel.
My excel sheet looks like this.
Because of some error I am not able to attach an image. Please see video.

{note: preview=no}
{nameofentity=split({clipboard}, "\t")[1]}
{ro=split({clipboard}, "\t")[2]}
{listofdirectors=split({clipboard}, "\t")[3]}
{listofdin=split({clipboard}, "\t")[4]}
Position of Selection: {position=location(listofdirectors, nameofsign)}
DIN: {dinofsign=split({listofdin}, ",")[{=position}]}
{endnote}
{note}
Company Details
Name of Company: {formtext: name=nameofentity}
Registered Office: {formtext: name=ro}

Director's Details
Director Name: {formmenu: {=listofdirectors}; name=nameofsign}
{formmenu: Choice A; Choice B; Choice C}
DIN of Director: {=dinofsign}
{=listofdirectors}
{endnote}

One of the cell of excel is having list of Directors separated by semi-colon. While using this value in formmenu, it does not create a drop down properly (please see the video)

Can someone help me to resolve this?
Thanks

Hi @Pratik_Shah,

There are two things you're missing.

  1. You need to use the split() function again in listofdirectors to split the data by semicolon
  2. You need to put values= before the variable name in order to assign that list as a list of options for the formmenu command.

Here's a simplified version:

{formparagraph: name=data; default=Mr Name1 Surname1\; Mr Name2 Surname2; cols=50}
{listofdirectors=split(data, "; ")}

{formmenu: values={=listofdirectors}; name=nameofsign}

Let me know if you need additional help.

1 Like

Thank you so much. That worked

1 Like

You're always welcome :slight_smile: