Allow a user to add multiple items to a list

I’m trying to allow a user to add multiple artists to a song. I was trying to use a Multi Dropdown element, but it won’t seem to let a user type a first and last name as a tag. How can I allow the user to add multiple artists to a song?

Is there a way to build something similar to the way you can add one to the database?

artistadd

I’m assuming you have it set up such that a “song” has a field on it called “artists,” which is a list of type “artist.” Is this a correct assumption?

Yes, that’s correct.

Is there a reason you can’t use a regular input field, and everytime the “add” button is click, a new artist object is created (or if an existing one exists, choose that one) and added to the song’s artist list?

@andrewgassen that’s what I’m trying to do.

How do I do that before creating the song?

Ah, I thought you already had a “song” created, and were trying to add things to it. Let me think a bit on that one.

@andrewgassen Yeah, I’m trying to do it while they add a new song.

I do something similar on one of my other apps. I’ll describe it to you in terms of your app:

  • When I click the button that brings me to this page, I’m assuming it’s something like, “Add a song” or something like that. But when that button is clicked, I create a new song called “TEMPORARY SONG”
  • I send that song to the creation page, which is looking for a type of “song”
  • Any changes that happen on that page just make updates to that page’s song. If you change the name, for instance, it’s no longer called TEMPORARY SONG when you hit the save button.
  • If the user hits “cancel,” I delete the current page’s song before navigating the user away
  • In case the user just closes the browser or clicks back, I run an API workflow to delete all songs called TEMPORARY SONG on a regular basis at like 3 in the morning.

Does this make sense?

That makes sense. I’m currently using a popup to create a new song, so I’ll see if I can do that with a popup.

This would all be avoided if I could create tags with multiple words in them.

Thanks!

If you used tags, though, you wouldn’t be able to fill out artist details or any of that type of info. I suppose that may not be important to your product, so it might not matter. I try to stay away from using plain text lists as much as I can, in case I’ll need that data one day.

I don’t create any artist data other than the songs that are added for that particular artist.

@andrewgassen This is the url to the site should it spark any other ideas. https://songsurge.bubbleapps.io/version-test/

I’m wondering if this can be done with a state

@andrewgassen how do you do this?

Why don’t you create a thing artist? And then link artist to song and vice versa? So artist has a field:songs and this is a list of songs and songs had a field artist and this is a list of artists.

Would that work?

That’s usually what I would recommend, but he says there’s no reason to have an “artist” object for the use case his app is covering.

@tyler.edwin.smith to send a song to a page or group, make sure the page/group is set to be of type “Song.” Then, the next step depends on whether it’s a group or a page.

  • If it’s a group, you will use the workflow action “Display Data.” Specify the group, then specify the Song that should be represented in the group.
  • If it’s a page, you will use the “Navigate to Page” action. There’s a field for “data to send.” Specify the song you want, and there ya go!

This topic was automatically closed after 70 days. New replies are no longer allowed.