I'm still having problems with this. I have two input types; text and email.
All I'm doing is updating file contents based on the input values entered. I set up all inputs as optional (because they won't all be updated every time) and then check further down the flow to see if they contain anything, but it seems that the triggerbody array is built dynamically and the unused inputs are discarded - so if I check for content on a discarded input it doesn't exist and the flow fails.
Is there a way to set the inputs as static, so that they exist in the triggerbody array as empty fields even if they're not used? Alternatively is there an expression function I can use to see if a triggerbody array element actually exists before I try to read it?
Thanks.
As an update. I've tried loading the triggerBody object into a compose card and checking for the input entries there. I can then tell if my input has been used (by whether it's there or not). I assumed that I could then use an if() expression to read it's value only if it existed in the compose output, but alas, if() expressions are evaluated in full so any reference to the missing value fails the flow again.
The answer is to have static fields that contain empty elements if an input isn't used. I can't imagine why they're dynamic in the first place. I can't see any benefit to it. There's no way to use optional inputs when you can't tell if they've been used or not without trying to read them and thus failing the flow.