Problem

Many sales people have to switch between their CRM and spreadsheets because all the data they need is not in their CRM.

With Actiondesk, it's pretty easy to solve this problem by feeding computed data to your CRM from other data sources (Stripe, Zendesk, Intercom or your own database for example).

Let's see in this tutorial step by step how to update Salesforce opportunities with computed data from a MySQL database.

Context:

Let's imagine a marketplace that lets students book lessons with teachers. Let's assume we have opportunities in salesforce for each one of our students.
We have in our database all the data related to bookings. We would like to get in salesforce the number of bookings booked by each student and the date of the last booking.

We've created two custom properties in Salesforce: "number_of_bookings" and "most_recent_booking" respectively with the types number and date

Workflow



Start by importing your Opportunities from Salesforce
Then, import the tables you need from your database. Here we'll import the tables "Bookings" and "Students"
In order to compute the number of bookings and the most recent booking data for each student, let's build a pivot table with the following parameters:

Pivot

When pushing data to Salesforce, a simple date will not work. We need to transform it into a timestamp in milliseconds. For that, let's add a column called "Most_recent_booking_timestamp" and use the function "DATETIMETOTIMESTAMP"

Most_recent_booking_timestamp

Now, we need to get for each student, the id of the associated opportunity in Salesforce. We are able to match an opportunity with a student because the name of the opportunity is the student's email. Let's first get the email from the students table by doing a vlookup with the following parameters:

Vlookup to get email

With that, we can get the opportunity id with another vlookup

Vlookup to get opportunity id

We're now ready to program our action (data push to salesforce). Let's click on program actions and choose salesforce
Choose Update records / Opportunities
Select id column: we need to input here the field from our dataset that matches with the opportunity id, in this case it's "id_opportunities"
Then, we need to map the fields in Salesforce with the fields from our dataset. First, we map "number_of_bookings" with "COUNT_of_StudentId", then "most_recent_booking" with "Most_recent_booking_timestamp"
Let's save this action
Lastly, let's schedule and publish our flow. Feel free to schedule at any frequency that you think is appropriate.

Conclusion

You will now have those salesforce properties updated at the frequency you've defined. Your sales people will not have to constantly toggle between spreadsheets and Salesforce, making them more efficient and probably happier as well
Was this article helpful?
Cancel
Thank you!