'Sending message to Pub/Sub when data is ingested to BigQuery or Google Sheet

For a project I need to apply some functions to data that is added to a Google Sheets or Google BigQuery table using Pub/Sub.

I want to pass the newly added table rows to listeners that are subscribed to the Pub/Sub topic. Essentially, the table contains some links with images from external websites and I want to automatically download them, store them in our google cloud storage bucket and add a link to the new location of the image to the original table. This is supposed to happen immediately after the data is received.

I cannot figure out how to publish a message that contains the new data to my PubSub topic once data is appended to my tables.

Does anyone know if what I am trying to achieve is even possible?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source