Forum Academy Marketplace Showcase Pricing Features

How can I register an item that already has a check box in the custom state?

I am creating a blog category selection function.
When creating a new blog, register the items selected in the check box in the database.
At the time of editing, the data registered in the database is called, and the items that have already been checked are checked.

The problem is that the condition to register in the custom state is “when checked”, so if it is already checked, it will not be registered in the database unless it is checked again.

Is there a way to solve this?
I also want to register the ones that are already checked in the custom state.

When checked, the item is registered in the custom state.

The selected item is displayed next to [Add].

Items that are already selected will not be displayed. For example, on this screen, “ttt” and “ttttt” are already selected categories.

Looks like you are storing the checked value on the Category itself?

you need to store a list of checked categories on your blog data type instead.

You could also consider using option sets if your categories wont be edited by the users much.

@nfisher
Thank you for your reply.
Categories and categories set for articles are managed separately.

“Article_Category” is the master, and the selected category is saved in " article_category" of each article.

You could check on page load. If this checkbox has been checked previously (and somehow saved at the database) you can make a Do a Search for while page load and set the states correctly (as if someone would click on it).

Greetings.

Sarah

@Sarah_Biberei

Thank you for your reply.
I thought about that method, but I don’t know how to set up the workflow, so please let me know.

What I did was try to go see the state of the checkbox when loading the page, but there is no checkbox in the menu.

I also thought about doing the checkbox action when the page loads, but it doesn’t seem to work.

You need to think differently here. You don’t want to check whether the checkbox is been checked. You need to check whether the value which represents the checkbox is stored in the database.

In your case it’s “ttt” and “tttt” in the article_category. You will need to check for your particular case whether this is already in your database (so to say it’s checked) and then either set the right states for that or present it directly in the checkbox (conditions, if something is true - present status (check).

I hope that helps.

@Sarah_Biberei

Thank you for your answers many times.

(conditions, if something is true - present status (check).

Does “condition” mean “conditional” on the attached screen?

I don’t know what settings I’ll make to achieve what you’re saying.

As a result of designing based on the advice, the purpose was achieved.
I did this by passing the Listed categories of IDs of the selected articles to Custom State in Set State.
Thank you for your advice.