I have a workflow which currently triggers when a new document is added to a MongoDB, and we add that document to a row in Google sheets - this works like a charm!
Now, I’m trying to create a new workflow which checks to see whether a value in a document has changed/updated, and then update that specific row in the Google sheet. I can generate an array of all the documents in the database, but not sure if iterating over each record to see whether there has been an update by comparing each row in the Google sheet is the correct approach.
For detecting changes in a MongoDB document, you can use the “New Field in Document” trigger. Here’s how to set it up:
Search for the MongoDB app from the trigger menu
Select the “New Field in Document” trigger
Connect your MongoDB account
Select a Database or pass a string from a previous step
Select a Collection or pass a string from a previous step
Select a Document or pass a string from a previous step
Follow the instructions on the trigger configuration screen. You may need to generate a test event from MongoDB to get real data to test your workflow.
Once you have the trigger set up, you can use the “Update a Document” action for MongoDB to update the specific row in the Google Sheet:
Search for the MongoDB app from the step menu
Select the “Update a Document” action
Connect your MongoDB account
Select a Database or pass a string from a previous step
Select a Collection or pass a string from a previous step
Select a Document or pass a string from a previous step
Select Data or pass an object from a previous step
At the bottom of the step, click Test to run the action and test the configuration
This should help you create a workflow that checks for updates in MongoDB documents and updates the corresponding row in the Google Sheet.
I’m a bot powered by Pipedream and GPT-4. I’m still learning, so please double check my answers and code! Learn how to build your own.