Editing a file - doesn't work

In my app, the user can upload files, which will appear in a repeating group. I have created a button to edit the file (or associated fields). Documents have a few fields, for example Description and Session’s Number (the last one is the cause of the problem, I think).

The problem:
When the users edits the Document’s description, the Sessions’s Number field gets emptied.

About the Session’s Number field: the document has a Session’s Number field (text), of which the possible options come from another data type (namely “Sessions”, with also a field called Number). I think here lies the catch. Can someone tell me what I did wrong here and why the Document’s Session’s Number field gets emptied when editing Description?

this is the number field of the popup/editing window:

This is the workflow when the user edits:

When the user opens the edit-popup, the proper Document’s session’s number is being displayed. See here that it gets emptied:

Does the ‘Input koppelan ann sessie E’ have a valid value when you run the workflow?

This is what I get when using step by step mode:

EDiting the description field:

Here the session’s number field already gets emptied

Are you resetting the data when the popup is closed?


Ah I see now what the issue is (I missed it before)…

As per your first post, your input element has no default value - so unless you manually enter a value, it has no value.

So when you make changes to your thing, you’re setting the value of that field to the input’s value, which is empty - hence why the existing data is being cleared.

You just need to give the input the correct default value, so that it will pre-populate with the existing value.

Thanks, that could be it.
But… I thought it was just the case of adding the Document’s Session’s number (“gekoppeld aan Sessie”) But Bubble is asking for more here. I can’t just enter the field. Do you know why? I see the error message but still am confused. Why can’t I just enter this value?

The default value HAS to be the same same type as the input’s type (obviously) - and the issue checker is showing you exactly what’s wrong here.

I don’t know your database structure, but you probably just need to change the dropdown choices source to Text, and set the choices source accordingly (although personally I try to avoid using text values as much as possible in Bubble - and it’s not clear in this case what the need to use a text, instead of some relational data, is - but then I don’t know anything about your app or database structure).

Also, I would delete the placeholder text if I were you (or at least change it to something more appropriate) - as it is it could cause confusion to your users, and cause empty values to be submitted by mistake.

Hmm I think what the problem is. But I don’t know the solution yet.

About the db-structure:
Datatype Sessions: has a Number field (type=text), to number the sessions (1, 2, 3 for example)
Datatype Documents has also a Number field “gekoppeld aan sessie”, which gets filled by the user. This is to assign/connect a document to a session.
When editing a document, the user should be able to change this number, but may only pick from the available session numbers.
Hence (this is the edit document number field):

I think that I cannot pick a default value from the Document datatype, while using the Session datatype as choices source.

Weird is that I CAN use the desired value in the placeholder field (see screenshot in this message)

Why are you using a ‘Text’ for that? - that’s what’s making things more complicated for you than it should be.

If you want to connect a document to a session, then add a ‘Session’ field to the document.

I think that I cannot pick a default value from the Document datatype, while using the Session datatype as choices source.


As things are, (and as I’ve already said in my previous reply) to make this work you’ll have to change the ‘Type of choices’ of your dropdown to ‘Text’ then set the datasource to be the relevant text value from the Search for sessies datasource.

But, that’s not the way to do this.

Set your database up correctly (using proper datatype relationships), then you can leave your dropdown as it is and it will work (and everything will be simpler).

Weird is that I CAN use the desired value in the placeholder field (see screenshot in this message)

Not weird at all - a Placeholder is just Text - and the value you’re using is Text - so it makes perfect sense that it works as a placeholder.

Well, it worked. I made the Type of Choices Text (for some reason I did not get that the first time you mentioned that).
Thanks for helping me (again :))!!

By the way I am using text for the number field because users then can also enter A, B, C as session numbers. Or 1, 2, 3, 3a, 4, for example)

1 Like