mattsch
mattsch2y ago

Looking for some advice I want to use a

Looking for some advice. I want to use a task extension to update multiple columns on a row, but it's not obviously documented. There's a change param that I can use, but the type is any so I'm unsure how I should use it. If I want to update multiple columns, should I do something like add the new/updated columns as properties to change then do ref.update(change) within the extension?
6 Replies
mattsch
mattschOP2y ago
In addition to this, I kinda want to create a single extension and then use it across multiple tables. Is this possible as well? Any ideas @harini and @Bhavya ✨ ? Ah, I went back and found your original advice @Bhavya ✨ : https://discord.com/channels/853498675484819476/853498675991937056/1098541793366245407
Bhavya
Bhavya2y ago
Hey @mattsch, yes! You can simply use ref.update() in your extension to update specific columns in your row. For example:
await ref.update({ payload: event })
await ref.update({ payload: event })
Here, payload is the field key and event is the value to be updated.
mattsch
mattschOP2y ago
is it possible to trigger the extension to run on all rows, or even a single row, similar to how derivatives can be triggered?
Bhavya
Bhavya2y ago
@mattsch, the Extensions can be triggered via the events selected in the Extension configuration. So, you can enable update for the fields and any changes in those column's data would trigger the extension. You can also use logging.log() statements to ensure the triggers: https://docs.rowy.io/cloud-logs.
No description
mattsch
mattschOP2y ago
Thanks @Bhavya ✨ . I had them configured, but I needed to manually trigger it again after updating the extension code. I'm trying to figure out a pipeline of pre-populated data that can then be enriched, so I ran my pre-populated function to import and then the extension did its magic, but it would be nice if there was a way to manually trigger the extension on one or all rows.
Bhavya
Bhavya2y ago
Great to hear that it worked for you, @mattsch! Thank you for sharing your feedback about the manual trigger option. We're actively working on building some cool features will resolve the issue of manual triggering of these scripts. Stay tuned for updates! 🚀