Create a thing if its value isn't found in another thing

I want users to be able to create their own Tags for articles, but I also want to curate these tags to better structure articles etc. Therefore I have 2 places for Tags - a data type for User Created Tags, and an option set for Curated Tags with a few other attributes.

Essentially users would use the existing Curated Tags, but if they feel the need to create a new tag, it will go into the User Created Tags data type.

To maintain speed, I will periodically curate the custom tags and add them to Cureated Tags, deleting the entry in the User Created Tags data table. Some User Created Tags will be removed if I think they’re hardly used, but may still exist in some articles.

As the Tags field on articles is a text list, there’s no issue with the tag being deleted and not being in the Cureated Tags option set, until the user wants to edit their article - if they do, and the tage deosn’t exist anywehre, it gets deleted from the list of tags on the article.

When the user decides to edit their article, I want to be able to check the database for all their tags, and if one is missing, recreate it in the User Created Tags table.

Any ideas on how to set up this workflow?

NB - this is not the actual scenario, but helps illustrate exactly what I am trying to achieve.

1 Like

Have tag as an object with an options set to identify their type

Tag
Title (text)
Type (options set “type”: system default, user created)
User (user)

Easier to manage :grinning:

Managed to work this one out - need to use backend workflows. This video is quite helpful in understanding haow they work.

Essentially, when the user clicks ‘edit’ I run the back end workflow that checks each of their Tags in the article if they exist in either the User Created Tags data type or in the Curated Tags option set. If a Tage doesn’t exist, then the backend workflow (Endpoint) creates a new Tag in the User Created Tags data type, therefore ensuring it’s available when they edit their article.

1 Like