Issue with Processing API Data in Server Script (Toolbox Plugin)

Hi everyone,

I’m trying to process JSON data received from an API call (Efento API) using the Server Script action from the Toolbox plugin in Bubble.

What I want to achieve - Convert the API response in this format:

into a simpler format by extracting specific fields and adding additional parameters (Workcenter and Company).

  • The data structure should be flattened to this structure:

    and sent to Bubble’s database via a bulk create API call.

My Setup:



  1. Step 1: API Call (Efento API) → returns JSON data with a list of measurements.
  2. Step 2: Server Script (Toolbox Plugin)
  • Inputs:
    • Thing 1: Workcenter (text)
    • Thing 2: Company (text)
    • Thing List 1: API call result (Efento API’s measurements)
  • Outputs:
    • outputlist1: Flattened JSON list (to be sent to Bubble API)
    • outputlist2: Debug JSON for verification
  1. Step 3: Bubble API Call (Bulk Create Measurements)

The issue:

  • The script runs, but instead of processing the data, Bubble only saves the initial test data from the API setup.
  • I don’t see the expected structured output being passed to the next step.
  • No errors appear in the workflow logs, making it difficult to debug.

I’ve tried many different directions but it looks like the script is returning empty value.

Could anyone suggest what I’m doing wrong? Any advice would be greatly appreciated.

Thanks in advance!

Not sure why you are using a server side script when you can do that with Bubble features.

Use :format as text on the results of step1:measurements

Hello,

Thanks for your response.

According to this what I know I’m not able to create multiple records based on API data pull in frontend. If there is a way, I would appreciate to share.

I tried your hint but there is an error:

What I’ve suggested is to use without toolbox. If you want to create multiple items in DB, you need to use schedule api workflow on a list and set the type to the API data and use get data from api to set the list.

Hi Jici,

in fact your 1st hint about turning this into text turned my thinking into correct direction. I skipped the whole step with JS and using format as a text I created package which fits to my database:

Thank you for your hints and this topic is for me solved/closed.

1 Like