I have a form where a user can input up to five dates. I want an action that checks for the first date and if it’s not empty, add three rows to a different sheet, then I want to check column for the second date and if it’s not empty, add three additional rows, etc. My action is currently stopping after the first date it finds. It adds three rows only for the first date it finds. What have I done wrong?
Compound IF’s like that always stop after the first TRUE condition, so it is working as intended in the sense that it stops after the first date check is true and only executes the actions under that true IF statement. That’s how compound IF’s work in any programming language and it’s also the same in Glide’s visibility conditions. Once a condition is true, it stops checking the other IF’s and is done. In your example, the other IF’s are ELSE IF’s that only run if the IF before it was not true.
As for fixing your problem though, that’s a tough one because currently, I don’t believe that Glide allows for any IF statements below that top level. Unfortunately for now, I think you might have to create a compound IF statement to cover every situation. (I’m going to assume 3 dates to check for this example, even though it looks like you have more.) So first you would check if Date1 is not empty AND Date2 is not empty AND Date3 is not empty…then add your 9 rows. Next you would check if Date1 is not empty AND Date2 is not empty, AND Date3 IS empty…then add your 6 rows. You would have to do the same to cover each scenario.
I was afraid that would be the case. Thank you for your explanation