Forum Academy Marketplace Showcase Pricing Features

Save data from custom state

Hello,

I encounter a situation that the page holds my custom states does not appear in the list when I want to define constraints or to save data. I figured out that the type of precede data has an impact on showing/ not showing the page (the element holding custom states). However, I don’t really understand the reason & how to solve it.

Here are usecases:

  1. I want to save text data stored in a custom state in a DB, into the field which is referring to another data type. The type of data in the referred field is also text.

Here is my Loom video: https://www.loom.com/share/df9469543cc541c08ae136ba42fe6e77

  1. I want to apply a constrain to filter the data based on a custom state. Here, the custom state is text but the field in DB is a list, also connected with another data

It looks like the trouble happens when the data type is a foreign key.

Thanks!
Ohyoon

Hey Ohyoon,

An element won’t show up as a possible data source unless the element has a custom state that is of the same data type as the item you are trying to set. In your example, the “Question” field is of type QUESTION, but since your page doesn’t have any states of type QUESTION, it will not show up as an option.

You can solve this in a couple ways, depending on your app:

  1. Create a state of type QUESTION, set that state to the appropriate question, then use that state to create your video
  2. Use the “Do a search for” datasource to search for questions whose text matches your state’s text

Hope this helps!


Getting stuck with your bubble app? Reach out to us at protomakr.bubbleapps.io

1 Like

Thanks! I didn’t know that two data types must match, and I didn’t know that it’s possible to assign existing data type when creating state. Good to learn!!