I would like to see a do a search for a thing’s fields, i.e. introspect and return all the fields of data type.
This would be very useful for:
Creating drop downs where you want the user to select the field of the thing dynamically.
Viewing a thing’s list of fields and values via a repeating group.
In fact in practice, at the moment I would like to do a dynamic filtering using operands and and or to search for multiple criteria dynamically. Currently my options are to hard-code (or hard-no-code) each field, which requires updating the system each time new fields are added and it does not allow selecting the same field in multiple sub-clauses of the search query. The better way would be to have a selection of the field via a drop down populated dynamically with the data of the thing and a value.
First, I agree with your comment. That would be a great convenience.
Second, personally I couldn’t live with the “in practice” options so a while back I came up with a solution. I’m not saying you should want or need to implement this. I’m just providing it as an option and example of what can be done in Bubble even now.
Full disclaimer: I wrote this as a proof of concept. It could be made into a plugin for easier implementation (and probably someone already has, I honestly didn’t care to look)
Use a server script to pass in a Data Type (properties.thinglist1 is “Do a search for Persons:first_item:converted to list”):
@bubble.trouble this element plugin version is a lot more efficient (faster) than sending that request to the server, though your idea and code are quite clever!
@umiumansa this can give you dynamic field labels. Check out the Output Options. Let me know if there’s some variation you can’t get here that you might want.
Note that there are no actions in this plugin, but it does trigger an “Initialized/Updated” event when its fields change and it has published the new field values (though there’s really no need for that to ever be used).
Plugin is forkable if you wanna see how I build plugins or tweak the code to your specific needs.
I’m facing a problem with your plugin as you can check in the link below.
This is error:
The plugin Missing plugin / element Fielder threw the following error: TypeError: Cannot read properties of undefined (reading ‘toUpperCase’)
at eval (PLUGIN_1663789938547x316869486314782700/Missing-plugin-initialize–Fielder-.js:61:164)
at Array.map () (please report this to the plugin author)
Oh, I guess it might not support empty values. I’ll look at that sometime soon but that error also says your plugin is “missing” you might need to reinstall it?
But actually … what you’re probably doing is passing a list of items. What you send it is a SINGLE example of the desired Thing (so like, Search for Thing:first item). It expects a thing, not an array of things.
Hey @fp1, upgrade Fielder to v 1.0.5 and let me know here when you’ve done that. This version writes some debug messages to the console so I can see what’s happening. (It’s not obvious to me why it fails for your things, but we shall see!)
Oh, OK. I see the issue. Looks like dash characters (and others) result in internal Bubble field names that have multiple underscores, not just single underscores between the words.
I just pushed version 1.0.8 of Fielder, which I believe fixes the issues that @fp1 observed. I also caught another couple of issues that would make Fielder not handle things quite right. Should be much more broadly useful now! (My original 1.0.6 fix wasn’t very great. I also found a couple of User system fields that I had neglected to handle. Anyway, this little plugin is rather better now.)
Yeah, all we can get here are Bubble’s internal representations of the field names. These are created when you first make the field and, if you change the field’s label, that does not change how Bubble references it internally.
What Fielder does is takes the internal field names and pass them back to us, with or without some formatting.
If you turn on debug mode in the latest version of Fielder, it will log some console messages that show you what your field names look like internally.
Hello @keith
I was researching topics related to dynamic fields and came across this post.
I was wondering if, following this same line of thought of your plugin solution, Would it dynamically identify one field of a Datatype (under a given conditional) within a repeater group? Or …do you have another way to do that?
I need something similar to the following screen. Could you give some help? (Thank you )