Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## note this hasn't been tested, but should work after modification per the use case
- ## The ingredients to the recipe
- providers:
- -
- type: org1Students
- properties:
- username: [username]
- password: [password+securitytoken]
- query: SELECT Id, Name, ExternalIDField__c, Affiliation__c, First_Name__c, Last_Name__c FROM Student__c
- isSandbox: false
- schema:
- fields:
- - name: Id
- type: String
- - name: Name
- type: String
- - name: Affiliation__c
- type: String
- - name: First_Name__c
- type: String
- - name: Last_Name__c
- type: String
- -
- type: org2Students
- properties:
- username: [username]
- password: [password+securitytoken]
- query: SELECT Id, Name, ExternalIDField__c, Affiliation__c, First_Name__c, Last_Name__c FROM Student__c
- isSandbox: false
- schema:
- fields:
- - name: Id
- type: String
- - name: Name
- type: String
- - name: Affiliation__c
- type: String
- - name: First_Name__c
- type: String
- - name: Last_Name__c
- type: String
- -
- name: org2StudentWriter
- type: salesforce
- properties:
- username: [username]
- password: [password+securitytoken]
- sfObject: Student__c
- isSandbox: false
- ### The instructions for how to mix the ingredients
- statements:
- ## Data Pipeline #1 - Students
- - statement: |
- (joinedStudents) => select a.Id SourceId,
- b.Id TargetId,
- a.Name,
- a.ExternalIdField__c,
- a.First_Name__c,
- a.Last_Name__c
- from org1Students a
- left join org2Students b on a.ExternalIdField__c = b.ExternalIdField__c
- ### Insert
- - statement: |
- (newStudents) => select
- Name,
- ExternalIdField__c,
- First_Name__c,
- Last_Name__c
- from joinedStudents
- where TargetId is null
- - statement: insert newStudents into org2StudentWriter
- - statement: |
- (existingStudents) => select
- TargetId Id,
- Name,
- ExternalIdField__c,
- First_Name__c,
- Last_Name__c
- from joinedStudents
- where TargetId is not null
- - statement: insert existingStudents into org2StudentWriter
Add Comment
Please, Sign In to add comment