[SOLVED] Why I can't set a dropdown to have a default value?

Can you be more specific? Which workflow are we talking about?

Here’s the forum app page:

In the blue stripe, you can add a new item to the drop down box. Here “Title” is a DATA TYPE". This all works fine.

However, in the pink stripe, “Title” is a Field of a DATA TYPE and so I don’t know what settings to do.

@emmanuel

I seem to be 95% of the way there…

I just need to know how to reference the Default Value for Dropdown C (which is the Medium 2 dropdown) (screenshot above) AND how to reference the Data to Display in the workflow (Screen shot below)

You shouldn’t refer to the default value, just the value of the dropdown. If the user doesn’t change it, it’s the default value, but if he/she does, it’s something else.

@emmanuel

"[quote=“emmanuel, post:24, topic:848”]
it’s something else
[/quote]

YES! something else… BUT WHAT???

on the forum app https://bubble.io/page?type=page&name=dropdown&id=forum_app&tab=tabs-2

I have the two identical set ups, and two identical groups… EXCEPT that one refers to DATA TYPES and one refers to DATA TYPE FIELDS.

HOW DO I MAKE THE Display Data refer to the NEW data???

RESOLVED this one.

Sweet

But before I go further… I want create a database of my art, as a logged on User.

Then, I want other Users to log on and create their own database.

Do I need to create all these workflows with USER as the top level of DATA TYPE, or is that handled at log in, and therefore any data will automatically “belong” to the logged in User??

That’s the the created by field is for, it gets attached automatically. See this [reference](https://bubble.io/reference#Data.Messages.CustomType.Created By).

I spoke too soon. This is not yet resolved… Maybe because I have all my Dropdown box groups in ANOTHER group (in order to capture the data for ALL the fields onto an image.

This is going to kill me.

I am slightly confused as to what you are trying to achieve here.

We have a list of Mediums and Titles, that we can select and add to.

Then you are doing something with “Obras”. What is this ? Would you not have the medium as a field type Medium, rather than Text ? You want Obras’s Medium … but which Obras are you trying to get it from ? What are you trying to default it to ?

Then there is the third Medium field … how is that different to the top two ?

@NigelG @emmanuel

The blue and red stripe workflows are great. They work just fine.

What I am trying to do with the green stripe is related to how my DATA functions.

In my post Data Structure from Excel I have structured my data like this:

(It’s a database of photos of art objects)

DATA TYPE: OBJECT Fields: Title (Text) Medium (Text) Size (Number) Series (Text) Photo (Image LIST)

So what I am trying to do is create a GROUP with all the fields inside it and when I hit the SET button all the data is saved to that OBJECT.

However, at the moment, each Field Input is held within its own OBJECT (Obras) Group. (And I need to put the image upload in a OBJECT field.

Is that how it should be?

OR should the Group surround ALL the Field Inputs (Including the image upload). But then I can’t get the workflow to work.

I think you should simply be able to store all of that on the OBJECT.

If I am understanding correctly, you want the drop down for a number of fields (Title, Medium, Series - these are existing values on the database) to be easier to enter via a drop down (but that you can add a new value to and that should then appear in the dropdown).

So you would set all those fields (via drop down), enter a size (do you want existing sizes in a drop down ?) and attach and image and save ?

And you may want multiple images ?

@NigelG It’s not quite that. I want separate dropdowns for a number of fields, which have some existing values, but that the User can add to each one. This we have achieved with the Forum App page

What I want to achieve now is the green stripe on that page:

A user uploads an image, and then selects the required fields, (Title, Medium, Series) adding new data where necessary. Then the User clicks the SET button, and hey presto, the data is all saved to that image. I’m working from the point of view of the OBJECT, so all these fields, including the image are fields of the DATA TYPE OBJECT.

Of course, some of the fields are text fields (Title, Medium) but some are lists… eg. there can be more than one photo of an OBJECT, there can be more than one price of an OBJECT (as it is resold over time).

At this point I am trying to figure out how to organise my groups. In the Blue and Red stripes of the Forum app, I can make all the above happen, but I wondered if it would make more sense to put all the dropdown input boxes and the image input into the SAME group. After all, each dropdown is currently in its own group, but all the groups are “Obras” (which is OBJECT in the actual data set I am using on my app).

Hope this makes sense!

Ok, got it.

We can use the brand new ":plus " function !

Will update the forum app later.

1 Like

Right, in your fabulous example in my data structure forum post Data Structure from Excel I missed the point that Medium, Title etc are ALSO Data Types, as well as being Fields in the OBJECT Data Type. Now that I know that, I am asking a different question to the one you are trying to answer!!!

Side note: I hope that i’ve given you some insight into how us Noobs think… it’ll help with your teaching Bubble enterprise, which is about to take off like a rocket! There was some talk of doing an online course… let me know if that progresses. I’d be interested in helping out with proofreading and testing lessons.
I’ll also be buying you a beer next time I’m in London!

1 Like

Yes, that is one way of doing values like Medium and at the time of writing it was the best way to do drop downs and the “add to list” function.

Bubble have now added the ability to add an item to a list “temporarily” which works nicely in this case. So we can now oull back a dynamic list of values from a text field, and add something to the list on the fly.

So we can do either, but I think it still might be a good idea to have a data type.

1 Like

Oh great… just when I thought it had only taken me a month to figure something out, you tell me Bubble has invented a whole new way of doing things!!! I’m sticking to what I have figured out already.

Well, maybe not a whole new way, but it is a bit tidier :slightly_smiling:

So instead of storing the “new” value on the database (where it might not get used) we store it on a custom state, and then :plus this to the list of existing values.

  1. On page page load each dropdown has a custom state set which is a list of texts, set to the existing values from the data base : unique elements only.

  2. Dropdown picks up the custom state for options. And a custom state for default.

  3. Input box sets the custom state to the same list of text values as page load :plus the input. Then it sets the custom state for default to the input, and resets inputs.

** you could just :plus the input to the custom state, but it looks a bit odd as you can add multiple rows to the drop down but they will then get lost if you save. **

In this way you only store the “new” value in the drop down if it is saved.

I took a copy of the page and amended. Doesn’t need groups this way, it uses states.

@NigelG This is beautiful. And much easier to develop the UI later after building the data flow, I think! I can easily adapt it to have PopUps for adding new data to lists, so that’s great.

But I have a question about setting the custom states. So I am trying to replicate with a new field (Extras, of Data Type Obras). I haven’t used custom states before, and I can’t find a way to see them once they are set, so copying is hard. This is what I have set:

But somehow I seem to have broken then whole thing, so I guess I have made a mistake somewhere…

Also, somehow I have lost the “choose a title” in the display of the dropdown boxes Series and Medium3. I’m pretty sure I didn change anything in those two at all!