- [Shankar] Hello, my name is Shankar Rajagopalan,
and I'm a solutions architect with AWS.
I'm here today with a demo
on how to use Salesforce Marketing Cloud Connector
for Amazon AppFlow.
I will build a couple of flows today
to show you how to securely transfer data
between Salesforce Marketing Cloud, AWS, and Zendesk
in just a few clicks.
For the first flow,
I will ingest data from Marketing Cloud onto S3,
and then I will show you how to quickly sample that data
using AWS Glue and Athena.
So let's dive in.
I'll start on my AWS web console.
And let's open S3.
I have pre-created a bucket that we share
called demo-datalake
with some random characters to make it unique.
I'll be using this bucket all throughout my demo.
Now, if you want to look for AppFlow,
you can start by typing the name on the search bar.
And you can click on this star
to add it as a favorite on your top bar.
I can show you the favorites that are there on my screen.
Or else, if you click on services,
it's under Application Integration.
You can find AppFlow over here, and you have the option
of adding it to your favorites over here also.
So let's click on AppFlow.
And I will start with creating a flow.
Let's click on Create Flow.
And, in the flow name,
I'll type in Salesforce Marketing Cloud to S3 demo.
Flow description is an optional field.
I'll go ahead and leave that blank for now.
I'm gonna leave it to the default encryption settings
and add a tag.
We'll add an environment tag and call it demo.
This is for me to keep track
of what's happening on my account.
I'll go ahead and click on Next.
Now, we're gonna choose a data source,
and our data source today is Salesforce Marketing Cloud.
Now, we go ahead and create a new connection
by clicking on Create New Connection.
To create a new connection, we would need a subdomain
for your Marketing Cloud instance,
then we would need a client ID and the client secret
for the OAuth 2.0 authentication,
and we would also need
the Salesforce Marketing Cloud subdomain endpoint.
Once you have entered those details,
you need to go ahead and specify a connection name
and click on Connect to create this connector.
I'll pause the video and enter those details
and create this connection.
The connection was successfully created,
and I named my connection
Salesforce Marketing Cloud connection demo.
If you click on this dropdown over here,
you should be able to list the existing connections.
Next, we choose the API version.
And there are a list of objects that are available for us
to download from Marketing Cloud.
And, for today's demo, I would be extracting subscribers.
Once we select the object,
we now need to choose a destination.
As of today, these are the destination
that is available for us to write to.
I'm gonna select S3.
Next, I'll go ahead and choose the bucket,
for which I have already pre-created the bucket.
It's the demo-datalake.
And I'm gonna leave the prefix blank
as AppFlow does that for me.
Now, for this demo, I'm gonna run this on demand.
You can always run the flow on schedule,
if you choose to do so.
And go ahead and click on Next.
On this screen, we're gonna map the data fields.
You can map the fields manually or build a CSV file
with the source and destination fields map
and then upload that using this option over here.
You're gonna do a manual mapping today.
And if you click on this dropdown,
it will give you an option to map the source fields
and the target fields one by one,
or you can do a bulk action and map all fields directly.
Since I'm going to use all the fields from the object,
I'm gonna say map all fields directly.
And it does that for me.
The next option over here is an optional one,
which is adding a data validation.
A common example for this one would be
if you want to skip certain rows
based on certain attributes.
Let's say, for example,
you wanna use the email address field
and make sure that it's always populated.
And if it's empty or missing, you wanna skip that row.
You do have an option to terminate the flow also,
or you can ignore the record.
So let's say this one, and then you can add that validation.
For today, I'm gonna ignore any validation
and just go ahead and click on Next.
Next, we're gonna add filters.
And based on these filters,
AppFlow is only gonna transfer those records
that meet this criteria.
Click on Add Filters,
and we're gonna select a date criteria.
Let's say CreatedDate.
And I'm gonna say is all records that have been created
after a certain date,
and I'm gonna go ahead and select,
gonna make it 21,
and go ahead and click on Next.
Review all the information
and go ahead and click Create Flow.
Now that the flow was successfully created,
I can go ahead and click on Run Flow,
and this will go ahead and run the flow
and extract a subscriber object
out of Marketing Cloud onto S3.
This flow is gonna run for a few minutes,
so I'm gonna pause the video and come back
once the flow has completed running.
The flow finished running successfully,
and it processed five records.
You can also see the run history of the flow
by clicking this tab over here,
and you would see that all the execution of the flow
would be listed down here.
Now, let's go ahead and take a quick look at S3,
and we had selected the demo-datalake
as the target location.
And let's click on the folder
which says Salesforce to S3 demo.
And here's where AppFlow created the folder
and wrote the data over here.
Now, a quick way to visualize this data
would be to put this in a tabular format
and add the ability to run some SQL queries on that one.
In order to do so, we can use a Glue crawler
to build a catalog for this data.
Let me go ahead and show you how to do that one.
We go and jump into the Glue console.
And, from here, I'm gonna click on Crawlers,
and we'll go ahead and add a new crawler.
I'll give it a name, Salesforce Marketing Cloud
demo crawler.
Next, it's asking me to specify the source type.
I'm gonna leave it at default.
Asking me to choose a data store.
I'll go ahead and select the path and the bucket.
So ours was demo-datalake,
and it's the sfmc-to-s3-demo folder.
I'll go ahead and select that. Click on Next.
I don't want to add another data store. I'll click on Next.
And I'll let Glue create a new role for me.
I will call it sfmc.
And I'm fine running this on demand,
so I'll go ahead and click on Next.
And it's asking me to create a database
where it'll output the schema and the table.
So I'll go ahead and add a database,
and I'll call the database...
I don't need a prefix,
so I'll keep rest of the things empty and click on Next.
And go ahead and click on Finish.
All right, so the crawler got added.
I'll go ahead and run the crawler right now.
And it's gonna take a few minutes.
I'll pause this video,
and once the Glue crawler is done running,
I will go back and show you how the table looks like
and what the schema looks like.
The crawler finished running successfully.
It gave me a message that one table was created
in the database that we specified.
Let's go ahead and check on the database.
The database that we chose was sfmc-demo-database.
Let's look at the table.
And we see that a table was created over here.
Here's the schema of the table that was created.
It's basically the fields that we had selected
during the flow creation.
We can go ahead and quickly run an SQL query using Athena
to look at the records in the table.
On Athena, let's open the query editor
and select the database.
We see the table being listed over here.
Let me go ahead and run a simple query
to select all from the table and run the query.
And we can see the five records.
This can come in quite handy when you have a large dataset,
and you want to run some sample queries to look at the data
or do some quick analysis on the data.
All right, now let's go ahead and build our second flow.
For the second flow,
we're gonna pull data out of Marketing Cloud
and write it directly to Zendesk.
For that, let's go ahead and click on Create Flow.
And we'll name our flow Salesforce Marketing Cloud
to Zendesk demo.
I'm going to leave everything as it is and click on Next,
and choose my data source as Marketing Cloud,
and the connection that we had created, API version.
We're gonna stick to the same object. That's subscriber.
And, for the destination,
this time, we're gonna choose Zendesk.
So I have gone ahead and pre-created the Zendesk connection.
And, as the destination object, I'm gonna choose users.
I'm gonna leave rest of them on their default setting
and click on Next.
And I will go ahead and manually map the fields.
The users object on Zendesk has only one required field.
And if you click this dropdown over here,
it tells you that the destination field required is name.
So I'm gonna select that,
and, on the source side, I'm gonna map email with name.
So I'm gonna click on map fields.
And just to keep it simple,
I'm gonna choose email again on the source side,
and there's an email field on the destination side.
I'm gonna map them.
For this demo, I'm just gonna keep it simple
and map these two fields
and go ahead and click on Next.
And let's add a filter.
Again, I'll choose a date-based filter,
and I'll say condition is after,
and I'll choose a year worth of range.
I'll click on Next.
Go ahead and click on Create Flow to create a flow.
And let me go ahead and show what it looks like
on the Zendesk site.
So I've logged into the Zendesk account,
and you can see that I got 30 customers here.
And, as we have seen from the previous flow
that my Salesforce Marketing Cloud has five users,
so I expect to see 35 users once this flow runs.
So I'll go ahead and click on Run Flow.
And it's just gonna take a few seconds or minutes,
so I'm gonna pause the video and come back
once we are done running the flow.
The flow finished running successfully,
and it processed five records as expected.
I'm gonna switch to the Zendesk now and refresh the screen.
And I see five records got added over here,
and I got 35 customers right now, so click on Next.
And these are the five records I see
that they got added four minutes ago.
So that wraps up this demo.
To recap, we ingested data from Salesforce Marketing Cloud
onto S3, and then we used AWS Glue and Athena to query it.
We then created a flow to ingest data from Marketing Cloud
and updated Zendesk directly.
I hope you found it useful,
and, until next time, thank you.