Log Record Data

Now that you've grasped the basics of Flow Auditing, we will avoid repeating the same content. If you need a refresher on how Flow Auditing works, please review the Flow Auditing Overview or the Flow Audit—Report to SightLane articles.

In this article, we will review the "Log Record Data" Flow Auditing Component and demonstrate how you can use it to save more time.  Imagine that you have an opportunity record variable in your Flow and you'd like to log some of its values at a particular point in your Flow logic.  You could add a bunch of assignment statements, but what if there are 30 fields to log?  Setting up 30 individual logging statements sounds like a lot of work!

 

Step 1:  Set up the Record Object

Instead, drag a "Log Record Data" action component from the SightLane Actions group onto the Flow Builder and give it an appropriate name. This component is compatible with any Salesforce data type, so we have to tell it what kind of object we will be logging...in this case, the Opportunity object.

 

 

Step 2:  Set Attributes to Control Logging Behavior

Once you've selected an object type, use the following attributes to configure your Record Logging content.

  • Record to Log - This is the actual data record whose values will be added to the SightLane log.  You can select any Opportunity record (since you chose Opportunity as the Object type).
  • Auto Log - If true, this advanced property will add the record's data values to whatever log is currently in process.  For example, imagine that you created a new monitor during a Trigger (in Apex), and during that trigger, an AutoLaunched Flow is executed.  The record logs generated would automatically be added to the current monitor that was initialized in the Trigger code.  These logs do not have to be separately reported to SightLane in the Flow.  The concept of "current log" is a little beyond the scope of this article, so we will leave it there for now.
  • Existing Logs - This is the set of logging statements to which the new values will be appended.  Usually, this will be the Log Collection Variable that you set up to catch all of the Flow's logging statements.
  • Fields To Log - This is the most important attribute and provides great content flexibility.  If this field is left blank, the resulting logs will contain every populated field, giving the reader a complete understanding of the state of the record.  If that is too much to read through (depending on the size of your object), you can use this field to specify exactly the fields you would like added to the logs.  This is 100% customizable and up to the designer.
  • Log as Single Line - This specifies the format of the logging.  If it is set to false (the default), each field of the record will be logged as a separate line.  If it is set to true, all fields will be written on the same line of the log, separated by commas (e.g. "Name=OppName, Stage=Closed Won, Amount=$25,000").  It's up to you whether you want to see data individually or in a more compact format.
  • Title - This is an optional parameter that inserts an additional log line just before the logged values.  It provides a way to announce what the next set of log lines represents (like "Opportunity Values"), instead of just showing a long list of data values.

Step 3:  Putting Updated Logs Back in Play

There is a final "output" parameter that uses the same SightLane_Event_Logs variable that was used for the Existing Logs property.  The component will take the "Existing Logs" and add the record values to them.  However, since there may be other logged content after this component, it's important that the whole set of logs is assigned to the original "Existing Logs" variable, which then holds the latest and greatest of all statements.  That way, future logging statements in the Flow will add to the existing auditing story.

The Log Record Data component is a great way to incorporate a lot of information into your Flow Audits without spending precious time writing individual logging statements.

Go ahead and give it a try.  We know you can do it.  If you run into any issues, reach out to us at support@sightlane.com.

 

Was this article helpful?
0 out of 0 found this helpful