I’ve used Call API workflow steps and template columns to edit multiple rows via a relation, initiated by a user action (button click).
Is it possible to set up a comparable workflow when the values being set are arrays?
I’ve used Call API workflow steps and template columns to edit multiple rows via a relation, initiated by a user action (button click).
Is it possible to set up a comparable workflow when the values being set are arrays?
Yes. Have you tried?
The method I’ve used so far is from Marco’s tutorial: https://www.youtube.com/watch?v=b7_k3_brusQ&t=752s
So I got tripped up by the template columns and not being able to use arrays.
If it’s going to involve using loops with webhooks, I think I need a cookbook-style tutorial as opposed to bullet points. I haven’t figured out user-initiated loops in Glide.
You don’t need loops, in fact I can’t imagine how it would even be possible with a loop. You just need to construct the JSON payload correctly. A multiple files column is an array type, so when setting it via the API you need to send a collection of values.
For example, let’s say you’re using a multiple files column for roles in your Users table, you might send something like:
{
"kind": "add-row-to-table",
"tableName": "native-table-xxxxxxxxx",
"columnValues": {
"Oqwdf": "Name",
"Name": "Email",
"euxYS": "Avatar",
"role": [
"Role 1", "Role 2", "Role 3"
],
"NzK5F": "AddedByID",
"o3nA9": "AddedAt"
}
}
NB: The method of constructing JSON shown in Marco’s video is a bit antiquated. Best practice now would be to use JSON Object and JSON Template columns.
Circling back here, wanting to learn the less “antiquated” way of editing multiple rows. Do you have any reference to point to or screenshots of JSON object and template columns used to edit multiple rows with the API? I’m just really struggling to understand the setup. I think it’s partly because there are so many options - using JSON in columns, workflows, or components. Once I have a working example, I should be able to start applying this to my use cases that don’t have multiple files, and once those are working, move on to uses that require arrays.
As the AI prompters would say, “Assume you are talking to an intelligent 5th grader….”
Here’s what I’ve figured out so far. I’m still basically using Marco’s method, but I used a JSON object column to construct the array, then using that object in a template column, then joining those templates in a list.
So I’m able to set a Multiple files column in multiple rows, but am still interested in a more elegant or up-to-date way to configure it.