Drop down menu issues

Hi, I'm struggling to get this drop-down menu to give me a blank space to enter other procedures that may not be on the list. I thought this would work but it doesn't seem to:

{note}Procedure:{endnote}{formmenu: default=Hysteroscopy; Smear; Curettage; Mirena insertion; Polypectomy; Endometrial ablation; Cervix biopsy; Vulva biospy; Anterior repair; Posterior repair; Total abdominal hysterectomy with BSO; Total abdominal hysterectomy without BSO; Laparoscopy; Other; name=Procedure; multiple=yes}{if:
Procedure="Other"} {formtext: name=Other}{endif}

Since you have a multiple-item formmenu, the results are provided as a list of strings. So instead of Other, the output when "Other" is selected is ["Other"].

What I would do is use the includes function to check if the user has selected Other. Here is the resulting snippet:

{note}Procedure:{endnote}{formmenu: default=Hysteroscopy; Smear; Curettage; Mirena insertion; Polypectomy; Endometrial ablation; Cervix biopsy; Vulva biospy; Anterior repair; Posterior repair; Total abdominal hysterectomy with BSO; Total abdominal hysterectomy without BSO; Laparoscopy; Other; name=Procedure; multiple=yes}{if: includes(Procedure, "Other")} {formtext: name=Other}{endif}

Does that help?

1 Like

Hi Scott
Thanks it works, I've learned something new!
Only problem is that I want 'other' to be blank or replaced by the new text that I enter. How would that be done?

Thank you

You can use a formatter on the formmenu to replace the "other" entry.

I think something like this should work. Please give it a try.

{note}Procedure:{endnote}{formmenu: default=Hysteroscopy; Smear; Curettage; Mirena insertion; Polypectomy; Endometrial ablation; Cervix biopsy; Vulva biospy; Anterior repair; Posterior repair; Total abdominal hysterectomy with BSO; Total abdominal hysterectomy without BSO; Laparoscopy; Other; name=Procedure; multiple=yes; formatter=items ->join(map(items, item -> item if item <> "Other" else other), "BLAZE_AND") }{note}{if: includes(Procedure, "Other")} {formtext: name=Other}{endif}{endnote}

1 Like

Hi

Thank you it works! I will have to read up to understand how the formatter works, but the problem has been solved.

Thanks again

Francois