Yes, it is possible now. Below example on how to do this with non-blocking action event, but you should be able to do this with filter event and modify the variable before initial database insert. The flow described below will do the update after data is already in database.
Trigger: event hook
type: action
scope: items create
collection: (choose target collection)
Condition
{
"$trigger": {
"payload": {
"field_name": {
"_eq": "_null"
}
}
}
}
(this means the flow will continue only if field/column "field_name" will be empty)
Run script
module.exports = async function(data) {
data.$trigger.payload.field_name = Math.abs(data.$trigger.payload.source_field);
return data;
}
Here we setting a new property with absolute value of "source_field"
Update data
collection: choose same collection
, IDs: {{$trigger.key}}
You need to switch input field to RAW editor before entering moustache variable here!
Then in payload
textarea:
{
"field_name": "{{ $trigger.payload.field_name }}"
}
This time do not switch to RAW editor!
This is how it looks like in the flow editor:
