Dropdown: hiding single answer from output

Hiya!
I'm building a decision tree with dropdowns. But currently I'm stuck, trying to figure out a way to not insert one of the options in the dropdown.
I know that you can put the whole formmenu into a note to suppress output. I'm looking to do that, but only with one of the options. In this case, the 'Choice A (hide this)' should show up in the snippet preview, but not the text that's eventually inserted. Do you have any wisdom for me? Cheers!

{formmenu: default=Choice A (hide this); Choice B; Choice C; name=TopLevel}{if: TopLevel="Choice A (hide this)"}{formmenu: default=Because there will be; another dropdown menu; with the relevant text.; name=LowerLevel}{endif}{if: TopLevel="Choice B"}Outputs some text{endif}{if: TopLevel="Choice C"}Outputs some text, too.{endif}

Hi @lynn.h Welcome to the forum! :slight_smile:

Are you looking for something like this:

{note}{formmenu: default=Choice A (hide this); Choice B; Choice C; name=TopLevel}{endnote}{if: TopLevel="Choice A (hide this)"}{note}{formmenu: default=Because there will be; another dropdown menu; with the relevant text.; name=LowerLevel}{endnote}{endif}{if: TopLevel="Choice B"}Outputs some text{endif}{if: TopLevel="Choice C"}Outputs some text, too.{endif}

I have used two {note} blocks to hide both of the formmenu commands in the snippet.

I am not sure if this is the solution, because as you mentioned, you already know how to do this. Now, if you're really looking to hide just one option out of all the formmenu optoins, then that's not directly possible to do. Can you explain the full context further - like why do you need to hide one option from the snippet insertion? Maybe with more context I can help you get to a better solution.

Hey Gaurang!
Thanks for your response! But, as you mentioned, that's indeed not quite what i'm trying to do :smiley:
I don't want to hide the whole formmenu command, but only one of the options in there.
This is, so I can create different levels in the decision tree with data that's not uniform.

'Choice A' for example, should act like a category, with subsections to choose from in another dropdown, while the other options from the top-level dropdown will just have a direct output. The Label of the category itself, should not be outputted.

I thought this may be possible, as with multi select formmenus, you can more directly target each option. I could change the dropdown to multi select, if that'd be helpful?

Would it work, if we did the inverse, and hide the whole menu in a note, but repeat an output of any selected option that is NOT 'Choice A'?

I see, that you want a nested menu. This would be similar to the right click menu in Chrome, for example (see image):

image

I hope my understanding is correct now. So, you can create this decision tree using two separate formmenu commands (like you did in your first post), but I can see that a nested formmenu can offer better usability in some cases.

As you have already noticed, we don't support nested menus out of the box (that would be a cool feature request :wink: ) I was able to create the following snippet, that roughly emulates what you asked for. But it is a bit cumbersome to use, so I don't think it solves the purpose you're looking for:

{original_values=["a": 1, "b": [ "c": 2, "d": 3 ]]}{values=catch(keys(original_values[selection]), keys(original_values))}
{formmenu: values={=values}; name=selection}

I think this is similar to what I did in my previous post, unless I'm misunderstanding your suggestion?