Go Back
DocuSign Reader
Publisher
: Lingk
Run In Lingk
Description
This recipe reads data from docusign status changes based on a filter. To execute, set a templateId variable in the Environment variables.
Browse the knowledge base
Twitter
E-Mail
# _____ _ _____ __ # | __ \ (_) |_ _| / _| # | |__) |___ ___ _ _ __ ___ | | _ __ | |_ ___ # | _ // _ \/ __| | '_ \ / _ \ | | | '_ \| _/ _ \ # | | \ \ __/ (__| | |_) | __/ _| |_| | | | || (_) | # |_| \_\___|\___|_| .__/ \___| |_____|_| |_|_| \___/ # | | # |_| # Project Name - DOCUSIGN READER # Recipe ID - # Recipe URL - https://app.lingk.io/a/10932/tf/17947 # Description - # This recipe reads data from docusign status changes based on a filter. # To execute, set a DS_TemplateID variable in the Environment variables # Industry - Higher Ed # Business Process - Graduate Reporting # Systems - docuSignReader # Connectors - docuSignReader # Data Flows - Single Direction # Connection Type - API to Localfile # Add Recipe notes / Change log information here! # _____ _ # / ____| | | # | | ___ _ __ _ __ ___ ___| |_ ___ _ __ ___ # | | / _ \| '_ \| '_ \ / _ \/ __| __/ _ \| '__/ __| # | |___| (_) | | | | | | | __/ (__| || (_) | | \__ \ # \_____\___/|_| |_|_| |_|\___|\___|\__\___/|_| |___/ # # CONNECTORS specify what data will be pulled into the in-memory database during processing connectors: # Configure DocuSign credentials in your Environment before running this recipe # DocuSign Setup - https://help.lingk.io/en/articles/268-docusign-connector-setup-guide ###### Start: DocuSign Connectors ####### # step 1: read from docusign - name: docuSignSample type: docuSignReader properties: useBearerToken: true resourceType: statusChanges fromDate: "2021/07/07" # today # fromDate: "{{ func:date_format(func:current_datetime(), 'yyyy/MM/dd') }}" # dynamic today include: tabs,recipients,custom_fields,documents,powerform,folders,extensions,templates # specify only what is needed to increase performance ###### End: DocuSign Connectors ####### ###### Start: LocalFile Connectors ####### # FORM: faculty add comp # step 2: read list of valid fields for template - name: facultyAddfields type: localFileReader format: csvFormatRead properties: fileName: "faculty_add_fields.csv" # last step: write the CSV output - name: formDataFile type: localFileWriter format: csvFormat properties: fileName: "faculty_add_comp_example.csv" #fileName: "faculty_add_comp_example_{{ func:date_format(func:current_datetime(), 'yyyy_MM_dd') }}.csv" # dynamic file name # END FORM: faculty add comp ###### End: LocalFile Connectors ####### # ______ _ # | ____| | | # | |__ ___ _ __ _ __ ___ __ _| |_ ___ # | __/ _ \| '__| '_ ` _ \ / _` | __/ __| # | | | (_) | | | | | | | | (_| | |_\__ \ # |_| \___/|_| |_| |_| |_|\__,_|\__|___/ # FORMATS specify how files should be processed as they are being read or written to writeFormats: - name: csvFormat type: delimited properties: delimiter: ',' header: true readFormats: - name: csvFormatRead type: delimited properties: delimiter: ',' header: true # ====================== NOTE ====================== # useBearerToken set to "false" uses explicit credentials (username, password, integratorKey, accountId) # useBearerToken set to "true" uses JWT bearer token (not yet implemented) # resourceType of "statusChanges" can use following options (filters): # fromDate # envelopeIds # transactionIds # folderIds # additional info: https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopes/liststatuschanges/ # ================================================== # _____ _ _ _ # / ____| | | | | | # | (___ | |_ __ _| |_ ___ _ __ ___ ___ _ __ | |_ ___ # \___ \| __/ _` | __/ _ \ '_ ` _ \ / _ \ '_ \| __/ __| # ____) | || (_| | || __/ | | | | | __/ | | | |_\__ \ # |_____/ \__\__,_|\__\___|_| |_| |_|\___|_| |_|\__|___/ # STATEMENTS specify how the data should be processed while in memory statements: #******************************************************************** D I S C L A I M E R *********************************************************************************************** # * # Note that in an effort to keep recipes optimized for DPH (Data Processing Hours), print statements should be commented out after development has concluded for a recipe. * # For more information on DPH optimization, please visit the following help article - https://help.lingk.io/en/articles/212-minimizing-data-processing-hours-on-the-lingk-platform * # * #******************************************************************** D I S C L A I M E R *********************************************************************************************** #- statement: print docuSignSample # Completed Form Data Items for specific templatesURI - statement: | (completedFormDataItems) => select distinct envelopeId, templatesURI, status from docuSignSample #- statement: print completedFormDataItems ## ## FORM: Faculty Add Comp Processing ## # Completed Form Data Items for specific templatesURI - statement: | (completedFormDataItems) => select envelopeId, templateSummaries[0].templateId from docuSignSample where status = "completed" and templateSummaries[0].templateId = '{{env.vars.DS_TemplateID}}' #- statement: print completedFormDataItems # Completed Form Data Items for specific templatesURI - statement: | (completedFormDataItems) => select envelopeId, templateSummaries[0].templateId, inline(formDataItems) from docuSignSample where status = "completed" and templateSummaries[0].templateId = '{{env.vars.DS_TemplateID}}' #- statement: print completedFormDataItems # Dynamically build the keys - statement: print facultyAddfields - statement: | (keys) => select concat("\"", concat_ws("\",\"", collect_list(name)), "\"") keyString from facultyAddfields group by id limit 1 #- statement: print keys - statement: INSERT keys INTO executionContext # Pivot the keys to a flatten the data for file or data based output - statement: | (completedFormDataItemsPivot) => SELECT * FROM ( select envelopeId, name, value from completedFormDataItems ) PIVOT ( first(value) FOR name IN ( {{executionContext.keys.keyString}} ) ) - statement: | (tranformedData) => SELECT BUSINESS_UNIT, DEPTID, JOBCODE, POSITION_NBR, ACCT_CD, OK_TO_PAY FROM completedFormDataItemsPivot #- statement: print tranformedData - statement: INSERT tranformedData INTO formDataFile ## ## END FORM: Faculty Add Comp Processing ## # Add more statements to convert, join, aggregrate, transform, and integrate your data
Element451 Writer
Normalize Unicode characters to ASCII characters