Using the data within the "Changed Fields" Pill

Alec Hanson
Tera Guru

Hi

I am trying to write Flow to trigger on change of a field and then take action based on previous and current value of that field.

Thought this would be easy but I am unable to get to the previous value. I have stripped back into a simple log flow and I can see the data in Trigger -> Changed Fields but I am unable to access the data within this individually.

As it is an array I have also tried to access the data in an array, but this is not working. Screenshot is below. I'm obviously not doing some in the flow I should be doing.

find_real_file.png

Thanks

1 ACCEPTED SOLUTION

Hi Alec - It looks like you are trying to log the changed fields from the Trigger Record.  What You need to do in your "For Each Item" loop, is reference the data pill for the specific FDChangeDetails record. See the example attached.  

Another item of Note in my example, the value of the field I am looking is a reference to the sys_id on the sys_user table user record, so I have to then go lookup the record with that sys_id to get the actual record I want to work with.find_real_file.png

 

Hope that helps!

View solution in original post

11 REPLIES 11

Chris Raga
Tera Expert

It is not possible to use a "previous" value unless you have stored that value elsewhere/previously in the flow. Flows run asynchronous to the database action, therefore, like Business Rules, previous is null when async.

Hi,

I get that the flow runs asynchronously, but on a "Record created or updated" Trigger it presents you with a Changed Fields pill which implies that it automatically captures the value so that it can be used elsewhere in the flow.

As per the above screenshot the Trigger<-Changed Fields data item HAS the data in an array - it is there, visible and accurate.

However if you navigate through the Pill data it breaks this down into the constituent fields of the array i.e. Trigger<-Changed Fields<-FDChangeDetails<-Previous Value and this is then empty.

The array itself still has the data but it is not accessible in the breakdown offered.

Alec

Hi Alec - It looks like you are trying to log the changed fields from the Trigger Record.  What You need to do in your "For Each Item" loop, is reference the data pill for the specific FDChangeDetails record. See the example attached.  

Another item of Note in my example, the value of the field I am looking is a reference to the sys_id on the sys_user table user record, so I have to then go lookup the record with that sys_id to get the actual record I want to work with.find_real_file.png

 

Hope that helps!

Thanks Brian that is wonderful and I can see that I was trying to access the data before looping the array. Fantastic!