Work with Bubble database data in Plugin editor

Work with Bubble database data in Plugin editor

If you want your user to pass the Bubble database data type to the Bubble plugin editor, how would you accomplish this?

Follow these steps:

Step 1:

Define the first field input as the "App Type" and the second as a dynamic value with the type of "first input type."

Drag the element to the editor, you will see two inputs:

- In the first input, provide the Input type.

- In the second input, supply the data.

Step 2:

Now, experiment with the input data in the plugin editor.

     //compute the length of the list 
    let list_length = properties.input_data.length()
    console.log("Length is ", list_length);
    //get the input data list
    var list_data =  properties.input_data.get(0, list_length);
    console.log("List data" , list_data);

    //loop over input list
     for (let idx=0; idx < list_length; idx++){
            //get the one item at time
                let list_item = list_data[idx];
             //this will list all the column of the given data type as the json array              
               console.log("list properties", list_item.listProperties());

              for(let prop=0; prop<list_item.listProperties().length; prop++){

                 //column name along with type , for ex- coulumn_name_type     
                 console.log("key:", list_item.listProperties()[prop]);  //event_name_text - event_name is the column name and text is the type
                 //its value
                 console.log("value:", list_item.get(list_item.listProperties()[prop]));

             }

        }

That's all for this blog. Subscribe for more future updates. Thank you!

Follow me on Twitter.

Checkout My Bubble Plugin Course - Use coupon code "THEBUBBLEGROUP" at checkout for 10% discount.

Did you find this article valuable?

Support Ankur Khandelwal by becoming a sponsor. Any amount is appreciated!