workflow before and after still available?

Do workflows still have access to a 'before' and 'after' for an updated record? It used to be, that one could see the state of the record before and after it was changed. Has this been removed, or is there a new mechanism for this?
10 Replies
Prastoin
Prastoin2mo ago
Hey @thomast could you please have a look to this when you have some free time ?
thomast
thomast2mo ago
Hi @166268424, before and after was unclear for a lot of users so we decided to remove it. Now you only see the updated record after update
166268424
166268424OP2mo ago
Thank you for the clarity and the quick response, I understand. As a note: we liked before and after. There is no workaround?
thomast
thomast2mo ago
We may add an advanced field where you could find the before but not planned yet. If you really need the "before", a workaround would be to set the variable directly without using the variable dropdown Variables coming from update events have the shape {{ some_step_id.properties.after.some_field_name }} so you could : - set a variable coming from the after using the dropdown - look in the console or log the actual variable that is stored - simply replace the after part in the variable by before
166268424
166268424OP2mo ago
Thank you very much, we will look into doing that. Hello, I have to admit, that I don't understand how to "set the variable directly without using the variable dropdown". Inside the codeblock I can only give values into the function via its parameters, or is there another way? When I try to type a popertychain like you provided into the inputfield it returns with "Not found". You said I can discover the structure of the update objects from the logs? I believe you mean once I have the object in the function I can see its structure, but how do I get it in there? Or do you mean in the logs of twenty? I could not see them there. It is probably clear, but not to me.
thomast
thomast2mo ago
It will indeed display not found, because this is not available in the schema - the variable dropdown. But before is still available in event. You just need to run a workflow once to see what is actually available in previous step output (see screenshot, before is there). So event if you see not found, as long as you take the same variable structure as for after, it will work despite displaying not found
No description
166268424
166268424OP2mo ago
Thank you again for the speedy response, we will try that. You are right. In the runs I can see what is given out by the trigger, that is really interesting. I'm sorry, that I have to ask again, but I still dont see how I can get that info in the next step. How would I get the before name in your example? In the input field I ignore the dropdown and type in {{ c92745f8-69b-4045-b402-v45fd25b6faf.properties.before.name }} ? Or do I need to type that into the function code as:
let a= c92745f8-69b-4045-b402-v45fd25b6faf.properties.before.name;
let a= c92745f8-69b-4045-b402-v45fd25b6faf.properties.before.name;
I was unsuccessful with both and I don't think I am even close.
thomast
thomast2mo ago
no, in your case, the stepId is trigger. So it will be trigger.properties.before.name. Here are steps to understand what I meant earlier: 1. Create your update event trigger 2. Create a second step, open the console and add a variable using the dropdown 3. Look for updateStep mutation, you will the variable you actually sent 3. Replace after by before
No description
166268424
166268424OP2mo ago
Thank you. Adding {{trigger}} as the input field was the solution. Then we can see the structure and work with it. The issue is resolved for us, thank you.
No description
No description
166268424
166268424OP2mo ago
:20:

Did you find this page helpful?