How do I create a JSON object using toolbox?

I am working on my first use of the toolbox plugin. I am trying to create a JSON object which is to flatten a complex, nested JSON return into a single array.

I am stuck getting the first test of it working. It keeps saying that
Uncaught ReferenceError: bubble_fn_querydata is not defined

Here is the JS I am starting with. It is in a workflow as a custom event.

const json1 = {
    "key1": "value1",
    "key2": "value2",
    "key3": "value3"
  };
console.log(json1);
bubble_fn_querydata(json1);

First step, I just want to create the JSON and output it to the log.

My goal here is after the JSON is created, I have a list in a custom state that contains columns I don’t want to include in the output. I want to test that object against the list and prep a CSV file that only contains keys not in the list of excluded columns. Then serve that file to the browser for download.

Do you have a JavaScript to Bubble element on the page with the suffix querydata?

note: it must be visible on the page for it to work.

1 Like

I just added it to the page and see my object in the console log!
Woohoo! Thanks!!

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.