Go Back
Logging custom data of recipe executions
Publisher
:
Run In Lingk
Description
This recipe shows you how to use the 'log' function to create a custom log that writes data to a custom log file. This log file can then be utilized by recipes to output whatever custom data is stored.
Browse the knowledge base
Twitter
E-Mail
# _____ _ _____ __ # | __ \ (_) |_ _| / _| # | |__) |___ ___ _ _ __ ___ | | _ __ | |_ ___ # | _ // _ \/ __| | '_ \ / _ \ | | | '_ \| _/ _ \ # | | \ \ __/ (__| | |_) | __/ _| |_| | | | || (_) | # |_| \_\___|\___|_| .__/ \___| |_____|_| |_|_| \___/ # | | # |_| # Project Name - Logging custom data of recipe executions # Recipe URL - https://app.lingk.io/a/10932/tf/18499 # Description - This recipe shows you how to use the 'log' function to create a custom log that writes data to a custom log file. # This log file can then be utilized by recipes to output whatever custom data is stored. # Systems - # Connectors - JSON # Data Flows - Single Direction # Connection Type - Static Data # Add Recipe notes / Change log information here! # _____ _ # / ____| | | # | | ___ _ __ _ __ ___ ___| |_ ___ _ __ ___ # | | / _ \| '_ \| '_ \ / _ \/ __| __/ _ \| '__/ __| # | |___| (_) | | | | | | | __/ (__| || (_) | | \__ \ # \_____\___/|_| |_|_| |_|\___|\___|\__\___/|_| |___/ # # CONNECTORS specify what data will be pulled into the in-memory database during processing connectors: # Configure JSON connector in your Environment before running this recipe # JSON Setup - https://help.lingk.io/en/articles/74-json-connector-reference # Source data - name: sourceLeadData type: json properties: jsonObject: > [ { "leadId": "1", "firstName": "John", "lastName": "Thomas", "leadScore": 88 }, { "leadId": "2", "firstName": "Anne", "lastName": "Jacobs", "leadScore": 32 } ] # _____ _ _ _ # / ____| | | | | | # | (___ | |_ __ _| |_ ___ _ __ ___ ___ _ __ | |_ ___ # \___ \| __/ _` | __/ _ \ '_ ` _ \ / _ \ '_ \| __/ __| # ____) | || (_| | || __/ | | | | | __/ | | | |_\__ \ # |_____/ \__\__,_|\__\___|_| |_| |_|\___|_| |_|\__|___/ # STATEMENTS specify how the data should be processed while in memory statements: # NOTE: You can add trasformations into your - statement: | (transformedData) => select leadId lead_id, ucase(firstName) first_name, lastName last_name, leadScore lead_score from sourceLeadData - statement: print transformedData # Reads the totalAmount value concatenating a string and store it into the executionContext variable collection - statement: (formedMsg) => select concat("Total Persons:"," ", count(*)) totalPerson from transformedData - statement: INSERT formedMsg INTO executionContext # The LOG function is reading what was inserted into the executionContext variable and is adding some other info as the data and category values - statement: LOG --message "{{executionContext.formedMsg.totalPerson}}" --data transformedData --category Person # Add more statements to convert, join, aggregrate, transform, and integrate your data
Read accumulated Logs by Organization
Writing Errors to a Salesforce Error Object