From 1f79d4cb76fa433c19ce8bb53c7e183b36fafca0 Mon Sep 17 00:00:00 2001 From: jaisree-jai <84732213+jaisree-jai@users.noreply.github.com> Date: Tue, 2 Jul 2024 14:22:31 +0530 Subject: [PATCH] Add files via upload --- ... contacts in front from google sheets.yaml | 254 ++++++++++++++++++ 1 file changed, 254 insertions(+) create mode 100644 resources/Create new contacts in front from google sheets.yaml diff --git a/resources/Create new contacts in front from google sheets.yaml b/resources/Create new contacts in front from google sheets.yaml new file mode 100644 index 000000000..246131ab9 --- /dev/null +++ b/resources/Create new contacts in front from google sheets.yaml @@ -0,0 +1,254 @@ +$integration: http://ibm.com/appconnect/integration/v2/integrationFile +integration: + type: trigger-action + trigger-interfaces: + trigger-interface-1: + type: event-trigger + connector-type: streaming-connector-scheduler + triggers: + SCHEDULE: + assembly: + $ref: '#/integration/assemblies/assembly-1' + input-context: + data: scheduler + options: + subscription: + scheduleConfiguration: + interval: + unit: minute + value: 1 + runOnceOncheck: false + days: + - MON + - TUE + - WED + - THU + - FRI + - SAT + - SUN + timeZone: UTC + action-interfaces: + action-interface-2: + type: api-action + business-object: worksheetRow + connector-type: googlesheet + actions: + RETRIEVEALL: {} + action-interface-3: + type: api-action + business-object: postContacts_model + connector-type: front + actions: + postContacts: {} + action-interface-1: + type: api-action + business-object: postAccountsByIdContacts_model + connector-type: front + actions: + postAccountsByIdContacts: {} + action-interface-4: + type: api-action + business-object: getAccountsByIdContacts_model + connector-type: front + actions: + getAccountsByIdContacts: {} + action-interface-5: + type: api-action + business-object: postChannelsByIdMessages_model + connector-type: front + actions: + postChannelsByIdMessages: {} + assemblies: + assembly-1: + assembly: + execute: + - retrieve-action: + allow-empty-output: true + allow-truncation: true + name: Google Sheets Retrieve rows + target: + $ref: '#/integration/action-interfaces/action-interface-2' + filter: + limit: 25 + where: + and: + - spreadsheetID: 1_s_ojnWjQY7i6pcBDcyhN0tOYU85jKUXdBYgGp2HVQs + - worksheetID: Sheet1 + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: flowDetails + $ref: '#/flowDetails' + pagination-type: SKIP_LIMIT + - for-each: + map: + $map: http://ibm.com/appconnect/map/v1 + customSchemas: + properties.`output`: + type: object + properties: + name: + type: string + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: GoogleSheetsRetrieverows + $ref: '#/node-output/Google Sheets Retrieve rows/response/payload' + - variable: GoogleSheetsRetrieverowsMetadata + $ref: '#/node-output/Google Sheets Retrieve rows/response' + - variable: FrontCreatecontact + $ref: >- + #/block/For each/node-output/Front Create + contact/response/payload + - variable: FrontAddcontactstoaccount + $ref: >- + #/block/For each/node-output/Front Add contacts to + account/response/payload + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: flowDetails + $ref: '#/flowDetails' + mappings: [] + source: + expression: >- + $GoogleSheetsRetrieverows[[1..$count($GoogleSheetsRetrieverows)-1]] + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: GoogleSheetsRetrieverows + $ref: '#/node-output/Google Sheets Retrieve rows/response/payload' + - variable: GoogleSheetsRetrieverowsMetadata + $ref: '#/node-output/Google Sheets Retrieve rows/response' + - variable: flowDetails + $ref: '#/flowDetails' + mode: sequential + continue-on-error: true + name: For each + assembly: + $ref: '#/integration/assemblies/assembly-2' + display-name: Google Sheets Title + - custom-action: + action: getAccountsByIdContacts + name: Front Retrieve account contacts + target: + $ref: '#/integration/action-interfaces/action-interface-4' + map: + mappings: + - id: + template: acc_e0vyak + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: GoogleSheetsRetrieverows + $ref: '#/node-output/Google Sheets Retrieve rows/response/payload' + - variable: GoogleSheetsRetrieverowsMetadata + $ref: '#/node-output/Google Sheets Retrieve rows/response' + - variable: Foreach + $ref: '#/node-output/For each/response/payload' + - variable: flowDetails + $ref: '#/flowDetails' + filter: + where: + id: acc_e0vyak + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: GoogleSheetsRetrieverows + $ref: '#/node-output/Google Sheets Retrieve rows/response/payload' + - variable: GoogleSheetsRetrieverowsMetadata + $ref: '#/node-output/Google Sheets Retrieve rows/response' + - variable: Foreach + $ref: '#/node-output/For each/response/payload' + - variable: flowDetails + $ref: '#/flowDetails' + allow-empty-output: true + - custom-action: + action: postChannelsByIdMessages + name: Front Create message + target: + $ref: '#/integration/action-interfaces/action-interface-5' + map: + mappings: + - body: + template: '{{$Foreach}}' + - id: + template: cha_g4xwc + - to: + expression: '["cct@gmail.com"]' + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: GoogleSheetsRetrieverows + $ref: '#/node-output/Google Sheets Retrieve rows/response/payload' + - variable: GoogleSheetsRetrieverowsMetadata + $ref: '#/node-output/Google Sheets Retrieve rows/response' + - variable: Foreach + $ref: '#/node-output/For each/response/payload' + - variable: FrontRetrieveaccountcontacts + $ref: >- + #/node-output/Front Retrieve account + contacts/response/payload + - variable: flowDetails + $ref: '#/flowDetails' + assembly-2: + assembly: + execute: + - custom-action: + action: postContacts + name: Front Create contact + target: + $ref: '#/integration/action-interfaces/action-interface-3' + map: + mappings: + - handles: + foreach: + input: '{}' + iterator: handlesItem + mappings: + - handle: + template: '{{$GoogleSheetsRetrieverows.values[0]}}' + - source: + template: '{{$GoogleSheetsRetrieverows.values[1]}}' + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: GoogleSheetsRetrieverows + $ref: '#/node-output/Google Sheets Retrieve rows/response/payload' + - variable: GoogleSheetsRetrieverowsMetadata + $ref: '#/node-output/Google Sheets Retrieve rows/response' + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: flowDetails + $ref: '#/flowDetails' + - custom-action: + action: postAccountsByIdContacts + name: Front Add contacts to account + target: + $ref: '#/integration/action-interfaces/action-interface-1' + map: + mappings: + - contact_ids: + expression: '$FrontCreatecontact.id ' + - id: + template: acc_e0vyak + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: GoogleSheetsRetrieverows + $ref: '#/node-output/Google Sheets Retrieve rows/response/payload' + - variable: GoogleSheetsRetrieverowsMetadata + $ref: '#/node-output/Google Sheets Retrieve rows/response' + - variable: FrontCreatecontact + $ref: >- + #/block/For each/node-output/Front Create + contact/response/payload + - variable: Foreachitem + $ref: '#/block/For each/current-item' + - variable: flowDetails + $ref: '#/flowDetails' + name: Create new contacts in front from google sheets +models: {}