Cannot save list from custom state to database

  1. I have a custom state that allows me to add players (to a list):
    Screenshot 2024-05-11 at 9.27.13 AM

  2. The custom state adds ‘Players’ one by one as a user selects them via workflow:

  3. However, when I try to ‘Save’ this state to the database, via workflow, the Custom state doesn’t show. I’ve done this same method before in a prior screen so I know it works, but for some reason it doesn’t show up for me here. Any thoughts?

Other info that might be relevant:
-I can see the Custom state working well as I have a text field that populates the changes as each player is added:

-The data type I’m trying to save to is ‘My Team’, in which the field is ‘Players (a list of players)’
Screenshot 2024-05-11 at 9.34.58 AM

Any help would be appreciated thanks!

Hey @jmoney :wave:

It looks like your custom state is on the page (assuming the name of the page is draft). Usually, the page is at the bottom of the elements data source, which is not visible in the picture. Can you show us that part of the picture as well?

bdk_512x512 @Huseyin from Flusk | Discover the #1 Security and Monitoring Tool for Bubble

Thanks for the quick reply @flusk !

That’s right, the page is called Draft. I’ve included the photos here, unfortunately I don’t think it appears on the list at all even if I ‘search’ for it or scroll to the bottom.


Instead of set list, you can clear list and add list.

bdk_512x512 @Huseyin from Flusk | Discover the #1 Security and Monitoring Tool for Bubble

On a second look, do you have two data types by any chance: Player and Players? Because I can see the custom state is a list of Players not Player.

bdk_512x512 @Huseyin from Flusk | Discover the #1 Security and Monitoring Tool for Bubble

@flusk - I might be misunderstanding but I tried two options and still running into the same issue.

  1. Did it in the same workflow:

  2. Separate steps:

The draft page (and it’s state) doesn’t show up.

Am I perhaps selecting the wrong ‘Thing to Change’?

Hey @jmoney. Can you please respond to my last message as well?

bdk_512x512 @Huseyin from Flusk | Discover the #1 Security and Monitoring Tool for Bubble

@flusk wow I think you nailed it… I had two different data types. :skull:

I’ll make the edits and see if it all works out - will keep you posted. Thanks a million I’ve been looking at this for hours.

1 Like

@jmoney,

Begin with referencing the element on which you had set the state. That way, you can retrieve it then save the list to the database. And also, instead of “add list”, I think “set list” would be suitable especially if the user is doing a selection. Hope this helps.

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