Hey @saybubble - so, if I understand your question properly, there are a few things that you might already be aware of (since you’re working with an external database) but that I want to make very clear:
-
The only type of objects that Bubble supports are Things (custom data types defined in your database), API response objects (for lack of a better term - these are Thing-like from a Bubble plugin API perspective, but do not have a “unique_id” field), and Option Sets (which aren’t really relevant here).
-
Bubble does not support arbitrary JavaScript objects. (Though, of course, if you have a text or a list of text, those strings could be formatted like JSON and so could represent JavaScript objects but Bubble cannot understand them as objects.)
-
The only real “objects” that we have in Bubble are Things and Things only exist in relation to the database. That is, there is no “in page” representation of a Thing, we cannot create a “temporary” Thing that only exists in the page, and plugins cannot create or modify a Thing. The only way that a Thing can be created is via the native “Create/Change/Delete a Thing” Actions. (To create a new Thing, we use Create a New Thing action. To modify a field on an existing Thing, we use Make Changes to a Thing, etc.)
-
To be very clear about point 3: In the Bubble plugin API, there is no facility for creating a Thing, destroying a Thing, or modifying the values of the values of the fields (keys) on a Thing. In JavaScript terms, Things are objects with some methods on them. But these methods only allow us to do two operations: (1) Understand what fields are on a Thing and (2) get the values of the fields. We cannot set or modify those fields. This can only be done under the Bubble programmer user via the native Create/Change/Delete actions.
-
As I mentioned, API response objects are Thing-like. They can only be created by the API connector. And, worse than the case with Things, there is no facility to modify any of the fields on an API response object (neither plugins nor Bubble programmers can do this at all). All API response objects are unique and just like with Things, all a plugin can do is understand what fields they have and what the values of a given object’s fields are.
So, given all of the above, don’t be confused about what Floppy’s RAM List is and what Floppy’s various RAM List-related Actions (like Change RAM List Value(s)
) do:
- Floppy’s RAM List is a Bubble List (Bubble’s version of an array).
- As with all Bubble Lists, Floppy’s RAM List has a type and can only hold values of that type.
- We can put new values of that type into the list, remove them from the list, reorder them in the list, etc.
- We can “change” an item in the list, but this does not mean “Make Changes to a Thing” (this can only be done via the native Bubble action) or “Change some field on an API response object” (there is no way to do that at all in Bubble). What “Change RAM List Value(s)” means is “replace some value with some other value”.
To be very, very clear about this, let’s say that you’ve set your Floppy to be of some Thing or Thing-like type. In this example let’s say it’s the native User type. Things (including Users) are referred to by their unique IDs but for the sake of simplicity, let’s just refer to them by their first names. I could use Floppy’s RAM List to hold a list of Users, let’s say I have:
[dick, jane, keith]
Now, I can do things like Swap dick and jane to get:
[jane, dick, keith]
And I could change the User held where dick
currently is, by using Change RAM List Value,
to User john
to get:
[jane, john, keith]
What “Change” means in this context is “replace this item with some other item”. It does not mean that you can “make changes to some field on the Thiing in the list”. Let’s say you wanted to take that list of Users and update some field on all of them. You could use the Bubble native action “Make Changes to a List of Things” with Floppy’s RAM List as the argument and (for example) change the value of some field on all of them. But you can’t do this in Floppy itself.
I think you probably understood all of that already, but if not, now you do.
Again, though it is stupidly limiting, there is unfortunately no way to have a generic object in a Bubble list. Generic JavaScript objects cannot be sent to Bubble plugins nor output by Bubble plugins as there is simply no such thing in Bubble and Bubble is strongly typed.
So, you’re essentially approaching this the right way. You can treat everything as strings (texts) and have two parallel lists (a list of full names and a list of bios) or you can just turn everything into strings (concatenate the name and bio data into literal JSON format or JSON-like) and do string manipulation on the values.
But then of course, you presumably want to communicate that back to Xano. So, presumably you need to have a call to Xano that can accept the list of names and list of bios and create new Xano objects from that.
But from what you describe:
… note that the “Empty Student” object (an API response object) cannot be changed inside of Bubble in any meaningful way.
Now, there are ways of abusing the API connector to do Thing-like in-page operations (that is, manipulate objects), but this involves communicating with the API connector to change an object. And, in this case what you’re doing is not actually changing the object, but getting a new object back from the API connector that has your desired field values set. This is the sort of thing that @jared.gibb is into and I assume that’s the sort of thing you’re doing here.
I don’t use Xano, so I can’t advise much further, but assuming you can make a new API call that can make a new Student with some field(s) set, just do that. And what you’re holding/managing in the page is text strings, not objects.
As I belabored above, you can’t create a new API response object by any means other than interacting with the API connector. Nor can you change an API response object that you get back from the API connector.
But you could collect the field values and then use the API connector to create an object back in your remote database that has those values. Or you might have an API call that - given the desired field values as arguments - changes the database object in question in your backend database.