Hi! Having a lot of trouble working with a List of Things. I already successfully worked with a Thing and a List of Texts, but if I check that blessed “Is a list?” box… all goes haywire.
How can one work with a List of Things feeded into the element action field?
To provide more details, I’ve created an app just to isolate and troubleshoot this issue, here’s the link to it: sdfsfsdfsdf | Bubble Editor
And in this screenshot I show what I mean by working with List of Things in the plugin editor “element actions” section:
In case you’re not opening the app to see what happens and how, I’ve included these other screenshots from the app:
This is a basic and useless workflow that feeds the List of Thing to the plugin’s element action.
And this is the app meltdown shown in the console:
The app also shows the “we ran into temporary issues…” alert.
I’ve met this situation when working with a Thing, took a while to understand how to fully work with them and eventually I made sense of it being then able to properly handle a Thing, but in this case it goes haywire without even typing any code into the element action code box! Like this:
What have I tried so far:
In the plugin I’m working on, using .get() and .listProperties() works fine when I feed a Thing, I do it like this:
let support4 = properties.support4;
console.log(support4.listProperties()); // Will list stuff for me
console.log(support4.get("Created Date")); // Will return the date
console.log(support4.get("lista_de_texto_list_text")); // Will return the list of texts (an array)
And I use this when I want to grab a Thing inside of another Thing’s field:
let getThingCeption = (firstThing, fieldOfTheFirstThing) => {
let returnedPropertyValue = firstThing.get(`${fieldOfTheFirstThing}`);
console.log(returnedPropertyValue.listProperties());
console.log(returnedPropertyValue.get("nome_text"));
}
getThingCeption(support4, "Created By"); // will return the properties of the thing that is held by this field/property that belongs to the first object, in this example "support4" and also print the specified field.
How in the world do I do anything with a List of Things?
@NigelG @levon @yusaney1 @jarrad @copilot tagged you guys because you’re my search reference here in the forums when I want to breakthrough an issue that is setting back progress for days!
Shoutout to Salar on Cobubble, or whoever made the plugin course, because that course was an awesome shortcut and skipped me a lot of headache!