Deleting Google Sheet Rows when a Salesforce Record is deleted

Hey everyone,
So I need some help, and I wanted to see any one could help.

I’m making a scenario where we’re storing data from Salesforce in a Google Sheet.
When new data is created, or existing data is updated, we create the row, or we edit the existing rows - that’s all good, we’ve setup the Salesforce outbound messages (webhooks) and we’ve got everything working.

HOWEVER

Salesforce Outbound messages can’t be configured when Salesforce objects are deleted (annoying). So I need an alternative way of dealing with it.
My alternative idea so far is to have Make look for all of the IDs stored in the Google Sheet in Salesforce every few hours.
If it can’t find an ID, we use the ID, find the row with that ID, and delete it.

But my stumbling block so far is that if I can’t find the ID, then it won’t know what ID to use.

Does anyone know if there is a way to store the ID that we searched that resulted in it not being found?

I’ve added a screen shot that shows the two IDs - one found, and one missing.

Thanks
Chris

I will write in my own words to make sure I got your point:

You have records in your Google Sheets that are synced with salesforce.
When you delete a record in Salesforce that delete action is not reflected in your Google Sheets.
You query Salesforce to find the ID in the row you’re editing
if you find the edit in SF, the is OK if Not then you need to Delete that Google Row?

I would suggest you to do the following:

Create a filter for the next step if the Total Number of Bundles =0 then get the rowid of the Google sheets and delete the row

2 Likes

Yep, that’s right, but that is also where I’m up to now.

I’ve created a filter for Total number of bundles == 0

I then search for the Google Sheet rows, using the ID from the Salesforce lookup.

But because the Salesforce search didn’t find it, it doesn’t have an ID, and thefore the Google Search Row doesn’t have an ID to look for.

How about changing the order of the steps, what I see is that you need the information in Google sheets to do the query, so you have the row ID from your google sheets and your Salesforce record ID, if the SF Id that you’re getting from your Google Sheets row is not found then just delete your google sheets rowid.

2 Likes

I managed to get this working in the end!
I ended up adding an array aggregator, and then itterator between Google and Salesforce.
Saving each record id as it’s own variable meant I could then use them further down the flow.

Thanks for your help on this one

2 Likes

Hey there @Rutter :wave:,

Just thought I might step in and pat you on the back for the great job you did while figuring out this problem. I’m thrilled to see you were able to learn more about the product and come up with a solution! :clap:
Also thank you for stepping back into the community and sharing your solution with us. We greatly appreciate that.

Keep up the amazing work!

1 Like