If command with multiple {formmenu} selection

Hi everyone!

Could you help me with entering the word "section" in case there is only one option and "sections" in case there is more than 1 selection?

My snippet:

The files under {if: Sections1......}section{else}sections{endif}{formmenu: name=Sections1; multiple=yes; “Section #1”; “ Section #2”; “Section #3”; “Section #4”; “Section #5”} need to be copied to the section {formmenu: name=Sections2; multiple=yes; “Section #1”; “ Section #2”; “Section #3”; “Section #4”; “Section #5”}.

Thanks in advance!

You can use the count() function for this. It returns the number of elements in a list.

I’ve edited your example below:

The files under {if: count(Sections1) == 1}section{else}sections{endif} {formmenu: name=Sections1; multiple=yes; “Section #1”; “ Section #2”; “Section #3”; “Section #4”; “Section #5”} need to be copied.

2 Likes

Thank you very much, Scott!