Field renaming of Bubble's Data thing

Hello community, I’m very much aware that bubble internally modifies the field name created in a data type.
For ex: Creating a field ‘username’ of type text would become → ‘username_text’ internally.

I’m struggling a bit in implementing a plugin which primarily depends on bubble’s data thing as input.

Let’s say I’ve a dataSource field for populating data for table element. I handled the case where if user creates a column such as username, id, etc. by just splitting and popping the last part which is the datatype(_text, _number).

The issue is if user creates columns like orderID, deliveryType, old_user, I’m having some quite difficult time in tracking these cases since bubble even modifies the casing to smaller ones.
How do we actually know like what casing does user gave in the data tab, because they might expect the same casing in output right ?

Please pour your insights on these things!!

We encountered a similar issue while developing our tool. Our solution involved utilizing the /meta endpoint, which provides the schema of an app, including the fields you’re interested in. For instance, a field in the schema might be represented as follows:

{
    "id": "name_text",
    "display": "name",
    "type": "text"
},

To access the metadata of any Bubble app (assuming the app has the Data API enabled), simply modify the Data API link. Change the last segment of the URL from ‘obj’ to ‘meta’:

Original: https://[your-app].bubbleapps.io/api/1.1/obj
Modified: https://[your-app].bubbleapps.io/api/1.1/meta

Regarding accessing ‘thing’ fields in your plugin, if you’re receiving them as input, it may not be possible to access their field id through the functions available in the plugin’s runtime environment. You might want to try using console.log(context) to explore what’s available.