How to update a list attribute of a thing?

I chose to use the “List of Things” when configuring my database, but know I’m kind of regretting because it complicates so many other flows. I got stuck in a single update:

  • I have a thing type called Category (text)
  • I have a filed called Subcategory which is a list of texts

This way I have a Category and all subcategories are inside this thing as a list.

I’ve set-up a RG to display the lists of Subcategories and their Category. So far, so good. I have a button inside this RG to edit the name of the subcategory, and that’s where the problem starts.

How can I update the current subcategory’s value? I tried several different configurations, none of them were successful, all had some kind of error.

My best guess was like this:

  • make changes to a thing (as I want to change a thing Category, not a list of categories)
  • do a search for Category’s Sub Category first item
  • inside the search I wud constrait the subcategory to be like the parent group’s text (i’ve send the data to the editing group)

I get the error: Thing to change should be anything saveable, but right now it is a text

And I dunno how to get out of it.

Can anyone clear me out here? @romanmg?

I probably would have created a new type of thing called Subcategory, that has a field called “Name” which is a text, and a field called Parent Category, which is a Category. Then, on the Category object, I’d have a field called Subcategories, which is a List of Subcategories. That would probably get you out of the sticky spot you’re in at the moment.

1 Like

Tks for the feedback @potentialthings. The main reason I structured it that way is because once a new user register, I have to copy more than 30 standard categories and subcategories, and build 30 workflows to “copy/paste” that didnt seem to be the best solution. I tried copying things and other flows that didnt work out and the only way I saw that was possible was creating a new thing for each subcategory.

But if I dont find a way here, I have no option… :wink:

I’m not sure I understand. Can you not use an API workflow on a list to add those things to each user when they sign up?

Because Im on the free plan, and it will take a while to finish this app. And API workflow is only allowed on the paid plan… :frowning:

Ah, I see. I’m not sure what I would recommend, then, as I think you’re going to encounter plenty of problems with Subcategories being texts instead of their own objects. Sorry!

Well, Im changing that. I agree with you.

@potentialthings But, how wud you set up a API workflow to copy things from a table where company ID is 1, and create other things in the same table but with company ID = 2? Even with API workflows, the options are the same on Data (Things).

Thanks for you comments, really.

Figured it out with 2 steps…

  1. Make sure I have a CompanyID for all Subcategories, and the standard one = 1
  2. Copy a list of things: this will make it duplicate the entire list
  3. Make changes to a list of things, with constrains “CompanyID = 1” and “Created date > 60seconds ago”


1 Like