EDUCAÇÃO E TECNOLOGIA

Migrating Customer Data from SAP Commerce Cloud to SAP Customer Data Cloud

Import from SFTP to Gigya: Registers customers with SAP Customer Data Cloud

{ "name": "Import from SFTP to Gigya", "description": "sftp > dsv > rename > account", "steps": [ { "id": "sftp", "type": "datasource.read.amazon.s3", "params": { "fileNameRegex": "<CustomerDataFromCommerce.csv>", "bucketName": "<AWS Bucket ID>", "accessKey": "<AWS Access Key>", "secretKey": "<AWS Secret Key>" }, "next": [ "dsv" ] }, { "id": "dsv", "type": "file.parse.dsv", "params": { "columnSeparator": ";", "addFilename": false, "inferTypes": true }, "next": [ "gigya.generic - initRegistration" ] }, { "id": "gigya.generic - initRegistration", "type": "datasource.write.gigya.generic", "params": { "apiMethod": "accounts.initRegistration", "maxConnections": 5, "apiParams": [ { "sourceField": "", "paramName": "isLite", "value": "FALSE" }, { "sourceField": "", "paramName": "dataCenter", "value": "<Site Data Centre>" } ], "addResponse": true }, "next": [ "field.add" ] }, { "id": "gigya.generic - Copy", "type": "datasource.write.gigya.generic", "params": { "apiMethod": "accounts.register", "maxConnections": 10, "apiParams": [ { "sourceField": "originalUid", "paramName": "email", "value": "" }, { "sourceField": "_response.regToken", "paramName": "regToken", "value": "" }, { "sourceField": "preferences", "paramName": "preferences", "value": "" }, { "sourceField": "", "paramName": "lang", "value": "en" }, { "sourceField": "", "paramName": "finalizeRegistration", "value": "true" }, { "sourceField": "password", "paramName": "password", "value": "" }, { "sourceField": "profile", "paramName": "profile", "value": "" } *If you have more fields that need to be modified and sent to SAP Customer Data Cloud, add it here. Else, remove this line.* ], "addResponse": true, "secret": "<Secret associated with user key>", "apiKey": "<Site API key to submit API call>", "userKey": "<User key to send API call>" }, "next": [ "record.evaluate - response" ] }, { "id": "field.add", "type": "field.add", "params": { "fields": [ { "field": "preferences.terms.mandatory.electronics.isConsentGranted", "value": "true" }, *If you have mandatory consents defined on the site, add them here as done above. Else, remove this line.* { "field": "profile.firstName", "value": "" }, { "field": "profile.lastName", "value": "" }, { "field": "password", "value": "" } ] }, "next": [ "Process Name & Password" ] }, { "id": "Process Name & Password", "type": "record.evaluate", "params": { "script": "ZnVuY3Rpb24gcHJvY2VzcyhyZWNvcmQsIGN0eCwgbG9nZ2VyLCBuZXh0KSB7CiAgIGlmKHJlY29yZCAhPT0gbnVsbCl7CiAgICAgICB2YXIgZmlyc3ROYW1lID1yZWNvcmQubmFtZS5zcGxpdCgiICIpWzBdOwogICAgICAgcmVjb3JkLnByb2ZpbGUuZmlyc3ROYW1lID0gZmlyc3ROYW1lOwogICAgICAgdmFyIGxhc3ROYW1lID0gcmVjb3JkLm5hbWUuc3BsaXQoIiAiKVsxXTsKICAgICAgIHJlY29yZC5wcm9maWxlLmxhc3ROYW1lID0gbGFzdE5hbWU7CiAgICAgICByZWNvcmQucGFzc3dvcmQgPSBNYXRoLnJhbmRvbSgpLnRvU3RyaW5nKDM2KS5zbGljZSgtOCk7CiAgIH0KICAgcmV0dXJuIHJlY29yZDsKfQ==", "notifyLastRecord": true }, "next": [ "gigya.generic - Copy" ] }, { "id": "record.evaluate - response", "type": "record.evaluate", "params": { "script": "ZnVuY3Rpb24gcHJvY2VzcyhyZWNvcmQsIGN0eCwgbG9nZ2VyLCBuZXh0KSB7CiAgIGxvZ2dlci5pbmZvKCJSZXNwb25zZSBNZXNzYWdlIiwgcmVjb3JkKTsKICAgcmV0dXJuIHJlY29yZDsKfQ==", "notifyLastRecord": false }, "next": [] } ] }