From 01ffa2f09769e4e5fdb5702ebaf7a8e136a0e7e2 Mon Sep 17 00:00:00 2001 From: shahminiaru <86762255+shahminiaru@users.noreply.github.com> Date: Thu, 14 Sep 2023 21:02:21 +0800 Subject: [PATCH] sf ae 2 Associate a new prospect to a list in Salesforce Account Engagement when a new subscriber is created in MailChimp --- ...ew subscriber is created in MailChimp.yaml | 323 ++++++++++++++++++ 1 file changed, 323 insertions(+) create mode 100644 resources/Associate a new prospect to a list in Salesforce Account Engagement when a new subscriber is created in MailChimp.yaml diff --git a/resources/Associate a new prospect to a list in Salesforce Account Engagement when a new subscriber is created in MailChimp.yaml b/resources/Associate a new prospect to a list in Salesforce Account Engagement when a new subscriber is created in MailChimp.yaml new file mode 100644 index 000000000..15ae11077 --- /dev/null +++ b/resources/Associate a new prospect to a list in Salesforce Account Engagement when a new subscriber is created in MailChimp.yaml @@ -0,0 +1,323 @@ +$integration: http://ibm.com/appconnect/integration/v2/integrationFile +integration: + type: trigger-action + trigger-interfaces: + trigger-interface-1: + type: event-trigger + triggers: + CREATED: + input-context: + data: Members + assembly: + $ref: '#/integration/assemblies/assembly-1' + options: + list_id: 6fc8383307 + parentFilter: + list_id: 6fc8383307 + connector-type: mailchimp + action-interfaces: + action-interface-3: + type: api-action + business-object: getApiV5ObjectsLists_model + connector-type: salesforceae + actions: + RETRIEVEALL: {} + action-interface-4: + type: api-action + business-object: postApiV5ObjectsLists_model + connector-type: salesforceae + actions: + postApiV5ObjectsLists: {} + action-interface-5: + type: api-action + business-object: postApiV5ObjectsProspects_model + connector-type: salesforceae + actions: + postApiV5ObjectsProspects: {} + action-interface-6: + type: api-action + business-object: postApiV5ObjectsListMemberships_model + connector-type: salesforceae + actions: + postApiV5ObjectsListMemberships: {} + action-interface-7: + type: api-action + business-object: postApiV5ObjectsProspects_model + connector-type: salesforceae + actions: + postApiV5ObjectsProspects: {} + action-interface-8: + type: api-action + business-object: postApiV5ObjectsListMemberships_model + connector-type: salesforceae + actions: + postApiV5ObjectsListMemberships: {} + action-interface-1: + type: api-action + business-object: Lists + connector-type: mailchimp + actions: + RETRIEVEALL: {} + assemblies: + assembly-1: + assembly: + execute: + - retrieve-action: + name: MailChimp Retrieve lists + target: + $ref: '#/integration/action-interfaces/action-interface-1' + filter: + where: + id: '{{$Trigger.list_id}}' + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: flowDetails + $ref: '#/flowDetails' + limit: 10 + allow-truncation: false + pagination-type: SKIP_LIMIT + allow-empty-output: false + - retrieve-action: + name: Salesforce Account Engagement Retrieve lists + target: + $ref: '#/integration/action-interfaces/action-interface-3' + filter: + where: + and: + - Pardot-Business-Unit-Id: 0Uv4L000000blJTSAY + - name: '{{$MailChimpRetrievelists.name}}' + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: MailChimpRetrievelists + $ref: '#/node-output/MailChimp Retrieve lists/response/payload' + - variable: MailChimpRetrievelistsMetadata + $ref: '#/node-output/MailChimp Retrieve lists/response' + - variable: flowDetails + $ref: '#/flowDetails' + limit: 10 + allow-truncation: true + pagination-type: TOKEN + allow-empty-output: true + - if: + name: If + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: MailChimpRetrievemembers + $ref: '#/node-output/MailChimp Retrieve members/response/payload' + - variable: MailChimpRetrievemembersMetadata + $ref: '#/node-output/MailChimp Retrieve members/response' + - variable: MailChimpRetrievelists + $ref: '#/node-output/MailChimp Retrieve lists/response/payload' + - variable: MailChimpRetrievelistsMetadata + $ref: '#/node-output/MailChimp Retrieve lists/response' + - variable: SalesforceAccountEngagementRetrievelists + $ref: >- + #/node-output/Salesforce Account Engagement Retrieve + lists/response/payload + - variable: SalesforceAccountEngagementRetrievelistsMetadata + $ref: >- + #/node-output/Salesforce Account Engagement Retrieve + lists/response + - variable: flowDetails + $ref: '#/flowDetails' + branch: + - condition: + '{{$SalesforceAccountEngagementRetrievelistsMetadata."status-code"}}': '204' + execute: + - custom-action: + name: Salesforce Account Engagement Create list + target: + $ref: '#/integration/action-interfaces/action-interface-4' + action: postApiV5ObjectsLists + map: + mappings: + - Pardot-Business-Unit-Id: + template: 0Uv4L000000blJTSAY + - name: + template: '{{$MailChimpRetrievelists.name}}' + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: MailChimpRetrievelists + $ref: >- + #/node-output/MailChimp Retrieve + lists/response/payload + - variable: MailChimpRetrievelistsMetadata + $ref: '#/node-output/MailChimp Retrieve lists/response' + - variable: SalesforceAccountEngagementRetrievelists + $ref: >- + #/node-output/Salesforce Account Engagement + Retrieve lists/response/payload + - variable: SalesforceAccountEngagementRetrievelistsMetadata + $ref: >- + #/node-output/Salesforce Account Engagement + Retrieve lists/response + - variable: flowDetails + $ref: '#/flowDetails' + - custom-action: + name: Salesforce Account Engagement Create prospect + target: + $ref: '#/integration/action-interfaces/action-interface-5' + action: postApiV5ObjectsProspects + map: + mappings: + - Pardot-Business-Unit-Id: + template: 0Uv4L000000blJTSAY + - email: + template: '{{$Trigger.email_address}}' + - firstName: + template: '{{$Trigger.merge_fields.FNAME}}' + - lastName: + template: '{{$Trigger.merge_fields.LNAME}}' + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: SalesforceAccountEngagementCreatelist + $ref: >- + #/block/If/node-output/Salesforce Account + Engagement Create list/response/payload + - variable: MailChimpRetrievelists + $ref: >- + #/node-output/MailChimp Retrieve + lists/response/payload + - variable: MailChimpRetrievelistsMetadata + $ref: '#/node-output/MailChimp Retrieve lists/response' + - variable: SalesforceAccountEngagementRetrievelists + $ref: >- + #/node-output/Salesforce Account Engagement + Retrieve lists/response/payload + - variable: SalesforceAccountEngagementRetrievelistsMetadata + $ref: >- + #/node-output/Salesforce Account Engagement + Retrieve lists/response + - variable: flowDetails + $ref: '#/flowDetails' + - custom-action: + name: Salesforce Account Engagement Create list membership + target: + $ref: '#/integration/action-interfaces/action-interface-6' + action: postApiV5ObjectsListMemberships + map: + mappings: + - Pardot-Business-Unit-Id: + template: 0Uv4L000000blJTSAY + - listId: + expression: '$SalesforceAccountEngagementCreatelist.id ' + - prospectId: + expression: '$SalesforceAccountEngagementCreateprospect.id ' + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: SalesforceAccountEngagementCreatelist + $ref: >- + #/block/If/node-output/Salesforce Account + Engagement Create list/response/payload + - variable: SalesforceAccountEngagementCreateprospect + $ref: >- + #/block/If/node-output/Salesforce Account + Engagement Create prospect/response/payload + - variable: MailChimpRetrievelists + $ref: >- + #/node-output/MailChimp Retrieve + lists/response/payload + - variable: MailChimpRetrievelistsMetadata + $ref: '#/node-output/MailChimp Retrieve lists/response' + - variable: SalesforceAccountEngagementRetrievelists + $ref: >- + #/node-output/Salesforce Account Engagement + Retrieve lists/response/payload + - variable: SalesforceAccountEngagementRetrievelistsMetadata + $ref: >- + #/node-output/Salesforce Account Engagement + Retrieve lists/response + - variable: flowDetails + $ref: '#/flowDetails' + else: + execute: + - custom-action: + name: Salesforce Account Engagement Create prospect 2 + target: + $ref: '#/integration/action-interfaces/action-interface-7' + action: postApiV5ObjectsProspects + map: + mappings: + - Pardot-Business-Unit-Id: + template: 0Uv4L000000blJTSAY + - email: + template: '{{$Trigger.email_address}}' + - firstName: + template: '{{$Trigger.merge_fields.FNAME}}' + - lastName: + template: '{{$Trigger.merge_fields.LNAME}}' + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: MailChimpRetrievelists + $ref: >- + #/node-output/MailChimp Retrieve + lists/response/payload + - variable: MailChimpRetrievelistsMetadata + $ref: '#/node-output/MailChimp Retrieve lists/response' + - variable: SalesforceAccountEngagementRetrievelists + $ref: >- + #/node-output/Salesforce Account Engagement + Retrieve lists/response/payload + - variable: SalesforceAccountEngagementRetrievelistsMetadata + $ref: >- + #/node-output/Salesforce Account Engagement + Retrieve lists/response + - variable: flowDetails + $ref: '#/flowDetails' + - custom-action: + name: Salesforce Account Engagement Create list membership 2 + target: + $ref: '#/integration/action-interfaces/action-interface-8' + action: postApiV5ObjectsListMemberships + map: + mappings: + - Pardot-Business-Unit-Id: + template: 0Uv4L000000blJTSAY + - listId: + expression: '$SalesforceAccountEngagementRetrievelists.id ' + - prospectId: + expression: '$SalesforceAccountEngagementCreateprospect2.id ' + $map: http://ibm.com/appconnect/map/v1 + input: + - variable: Trigger + $ref: '#/trigger/payload' + - variable: SalesforceAccountEngagementCreateprospect2 + $ref: >- + #/block/If/node-output/Salesforce Account + Engagement Create prospect 2/response/payload + - variable: MailChimpRetrievemembers + $ref: >- + #/node-output/MailChimp Retrieve + members/response/payload + - variable: MailChimpRetrievemembersMetadata + $ref: '#/node-output/MailChimp Retrieve members/response' + - variable: MailChimpRetrievelists + $ref: >- + #/node-output/MailChimp Retrieve + lists/response/payload + - variable: MailChimpRetrievelistsMetadata + $ref: '#/node-output/MailChimp Retrieve lists/response' + - variable: SalesforceAccountEngagementRetrievelists + $ref: >- + #/node-output/Salesforce Account Engagement + Retrieve lists/response/payload + - variable: SalesforceAccountEngagementRetrievelistsMetadata + $ref: >- + #/node-output/Salesforce Account Engagement + Retrieve lists/response + - variable: flowDetails + $ref: '#/flowDetails' + output-schema: {} + name: Associate a new prospect to a list in Salesforce Account Engagement when a new subscriber is created in MailChimp +models: {}