Before you submit your video, this form allows you to view the tags a user wants to add to a video.
Since the number of apps can be unlimited, the user types it in the input text box. I want to display the tags in a repeating group, but I’m just not able to figure it out.
I will store all the values in the database once the registration is complete, but before that, I want to manage it at a state level.
It sounds like the apps will already exist in the database, and the user is searching for them in order to list them as favorites, is that correct? In other words, do have App as a database thing, which the users would be selecting from when registering?
If that’s the case, you can create a custom state of type App, and make it a list. As the user adds or removes their App tags, you add/remove from this list. Should be pretty straightforward.
Why are you waiting until the user enters their favorite apps to register them? Seems like you’d risk losing them at that step. Why not register first, then have them list their favorite apps? If they leave at that stage, you can remind them when they come back to the site.
John - It sounds like the apps will already exist in the database, and the user is searching for them in order to list them as favorites, is that correct? In other words, do have App as a database thing, which the users would be selecting from when registering?
Imran - No sir. The user can type in anything and it won’t search in the database for these tags.
In that case, what are you wanting to store in a custom state? Based on your screenshot, and if the items are just names of apps, seems like it would just be text? If so, you would use the same solution I suggested, just with a list of texts instead.
What exactly are you collecting for these apps, and how do you want to store them? For example, are you just going to store them as a list on the User, or are you going to store each separate entry in a db App table, or something else?
More details around what you’re trying to do and what you’ve already tried that didn’t work would be helpful.
Sure. The user registration scenario, was just an example.
This is the real use case.
I’m building an app for users to keep their videos organized. Every user would use their own words to relate to their videos and search for them later using these tags.
This is what I’ve done uptill now -
I have a custom state setup on the page called ‘Tags’. This is also a list.
In the frontend, the user has an option to enter tags in an input field. Next to the input field is a button to ‘Add’
Below this, I have a repeating group that allows the user to see all the tags that have been added to the custom state ‘Tags’.
Can you show the workflow that’s run when “Add” button is clicked?
You can check if they’re getting added by running the app in debug mode and inspecting the console element that you have the custom state on. It’ll show you what’s in the state and you’ll be able to see directly if they’ve been added or not.
In general, the debugger is your friend, especially in cases like this. If your texts aren’t getting added, then I would suggest running your workflow in step-by-step mode to see where things are going wrong. It’ll take some time but it’ll be well worth it.
When you’re setting the state, you have the value field blank, so it’s definitely not getting added. You have to tell it what you want the state to be.
What you want to do is reference the current list then add the new item (if you just put the value as the most recent you’ll overwrite). So the value should be something like:
Included_Tags: add item: Input Tag Text's value
Then it should get added. If you have an “x” by a tag for them to remove, you’d do the same except remove: