I would like that the date and time is registered when a button was pressed, but I want it in different columns based on a dropdown list (select list column).
E.g. If in the select list (Status) the value is “Selected” I want that the date and time of the button press is displayed on the column called “Selection date”, if the status is “Confirmed” then I would like that the date and time when the button was pressed is displayed on the “Confirmation date” formula. etc.
I am trying to use SwitchIf formula inside the ModifyRows formula, but unfortunately with this I don’t get the column as a result but a date as a result and it gives an error to me.
Do you have any suggestion how to make it work?
I created this formula:
ModifyRows(thisRow,switchif(thisRow.Status=Selected,thisRow.[Selection date],thisRow.Status=Confirmed,thisRow.[Confirmation date],thisRow.Status=Completed,thisRow.[Completion date],Now()))
I didn’t take a look at your doc, just formatted your formula with some tabulations (it helps me read code more easily) and I think your mistake is that you left the Now() inside of the switchIf().
The only thing that I have to be cautious is that in case I change the select list items, I will have to be aware to change it also in the Switch formula, value part. I cannot link it so it changes if I change in the select list.
That should not be the case, as you can see in the screenshot below both the possible values for Status and the date columns are chips. That means that if you change the name of the options in your select list or change the name of the columns, then everything will be dynamically updated and you won’t need to change the formula. If you add new options or new columns, of course you need to update the formula.
Maybe the problem was that when copying my code snippet the select list values were pasted as strings, therefore they wouldn’t be dynamic anymore.
Just type = next to Status , start typing the value and press Tab, so that the chip for the value will be generated. Then you can cut/paste it to the right place in the formula.
Again thank you very much for your support! At the end I created a table instead of a select list and in this way I managed to create the “chips” instead of the strings. But it’s good to know it is possible with the select list too!