Clearing fields when updating record in Workflow

I need a post-action workflow that updates a record by clearing a field when the user pushes a button.

How can I clear the content of the field or insert a NULL in it?

I have worked around it by adding a SQL query node but I am sure there must be a simpler way.

Thanks!

Thank you for the reply.

Null doesn’t appear in my workflow:

What am I doing wrong?

Is this an option field? It looks like a bug.

It might be due to the version of NocoBase you’re using. This option is only available in more recent versions. I have this option in my environment. You could try deploying a more recent version, but make sure to do this in a sandbox environment to avoid any issues. If updating isn’t an option, another way to achieve this is by using a variable (if you have the workflow variable plugin installed).

It is an option field but it does the same in the next field with is markdown text.

My Nocobase version is v1.2.33 alpha.

If updating isn’t an option, another way to achieve this is by using a variable (if you have the workflow variable plugin installed).

How do you set a variable to NULL?

By using a variable node, you can declare a node variable and set its value to null. You can then use this variable to assign its value to a field in an update node.

image

image

image

There is one more way I can think of to solve this problem, but it requires two additional plugins (one of which has a cost). However, if I were in your position, I would try to find a way to correct the update record to properly assign the null value.

This may be a version issue. Please upgrade to latest version.

BTW: this feature is implemented in July: refactor(client): allow to select null value explicitly in variable input by mytharcher · Pull Request #4869 · nocobase/nocobase · GitHub