One Field, Automated Column Selection?

Is it possible in Bubble to use a field that stores the input in the correct column based on the data it is passed?

I have a window that asks for a [date] and a [file] and it displays the relevant text based on the state of the window, which is set via a workflow.

For example - If you click the [Monday] button, the workflow changes the state of the window to “Monday” so the text is displayed appropriately.

In the database there are columns, [Monday Date], [Monday File], [Tuesday Date], [Tuesday File] and so on.

Is there a way for the fields to dynamically store the data entered into the [date] and [file] inputs based on the state of the window?

For example - If you open the window with the state “Monday”, can I get the data to store in [Monday Date] and [Monday File] columns, or the same for Tuesday?

If not, is there a better way or am I going to have to create 7 windows, one for each day of the week?

PS: I’m not actually using days of the week, but its easier than explaining my whole system.

Just use conditions on the actions.

(or, if you only want to use a single action, you can use conditional statements, formatted as text, for each field int he database, so as to only update the one that needs updating).

But for what it is, the first option is probably the simplest.

So, just create a workflow when the user clicks the Submit button that has multiple steps?

Step one: Put the date in [Monday Date] only if the Window state is “Monday”

Step two: Put the date in [Tuesday Date] only if the Window state is “Tuesday” and so on?

Yeah… exactly…

I probably wouldn’t do that it there are dozens of possible Window states, but if it’s just a handful then it’s the simplest way.

Another alternative, would be to use the Date API, as you can make the field name dynamic

Everything is working as expected, stepping through with the debugger, it shows that the condition is met, but no data is written to the database.

This is beyond my ken now, I’m not sure why it’s not passing the data through.