Optional input for Microflow behind Datagrid action button

Hi everyone, I have got a datagrid with multiselect enabled. I now want to call a microflow and pass the selection of said datagrid to it – regardless whether there is an input at all. However Mendix does not appear to support optional inputs. Meaning if the microflow has a list input, the button cannot be clicked if no selection is available. However I want the microflow to be called nonetheless, just with the input list set to empty.  Is there a workaround for this? Two seperate buttons could be an option but only if they are not visible at the same time. Which leads me to the problem, that I cannot make the visibility dependent on the datagrid selection as far as I know…   Any help is greatly appreciated. Thanks
1 answers

Hi Jonas,
I don't believe this is possible because when choosing Multi-selection in your Datagrid the microflow always expects a list as argument for this microflow (either a selection or all rows, as you can see under ‘Edit on click microflow settings...’). Second part of your question: no, you can not make the visibility dependent on the Datagrid selection.
My question would be if you really need to have this button perform these 2 actions, or could you separate the logic? If you want to create an empty list anyway, you can just create another button, like you suggested, (within or without the Datagrid) and create an empty list in the microflow to begin with.
Wanting two logical operations in one button (one with an argument, and one without), suggests these are actually two different actions and should be separated for maintainability and structure. That's the reason for my follow-up question.
Good luck!