How to update the field ID automatically given by Bubble?

Well, we know that when we create a field in a datatype, that field automatically receives a unique ID based on the first label (display) we give it. If this label is changed later, the unique ID will remain the same, the only thing that will change will be the new label.

So if we label a field as “First Name”, the ID created will be “first_name”, since Bubble automatically converts everything to lowercase and replaces characters like space with underscore “_”.

Well, if I now change this field label from “First Name” to “Full Name”, its unique ID will continue to be “first_name”.

For most people this doesn’t make a difference, but this can become a mess if you need to do external integrations and want to expose unique IDs instead of the field label for key names.

image

My question here is…

1 - Is there any way to change these unique IDs given by Bubble so that they reflect the current state (label) of the field?

2 - The same thing occurs to datatype names, option set names, option set attributes, is that right?

3 - I believe in the past I saw something mentioning that these changes could be made by exporting the app’s JSON, changing this in the JSON itself and reimporting again.

  • Is this really possible to change by carrying out this process?
  • Assuming I did everything correctly, how sure would I be that when reimporting the JSON, all my app’s resources would be “reconstructed” correctly, since many things will be associated with these fields?
  • Even if I didn’t change anything, has anyone tried exporting the JSON and reimporting it again to make sure what happens?

Thank you in advance for any help with these questions.

No

Yes

Plausible, you can try just a find and replace but that will extremely likely screw up data in the database (as DB columns are defined by ID, if you change the ID, then it’ll just create new columns in the DB / not link with the old data). Don’t do this.

You can use field display instead of the ID using the checkbox you showed, just make sure you don’t inadvertently change a field name for something that is used externally.

2 Likes

Thanks @georgecollier !

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