Skip to content

Commit

Permalink
sf ae 2
Browse files Browse the repository at this point in the history
Associate a new prospect to a list in Salesforce Account Engagement when a new subscriber is created in MailChimp
  • Loading branch information
shahminiaru authored Sep 14, 2023
1 parent d1cd946 commit 01ffa2f
Showing 1 changed file with 323 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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: {}

0 comments on commit 01ffa2f

Please sign in to comment.