I finally figured out a way to properly send JSON to Bika Webhook. The challenge now is how to start storing that JSON data.
What is the recommended way to mass insert/update a Bika db?
Creating a loop that first searches the db and then inserts a new value seems tedious. Can Bika please solve some of these basic Create Update Retrieve Delete operations for us by either providing an automation example that does this or publish scripts in python/javascript that accomplishes this?
Solving these kinds of basic things will allow users to start using Bika more easily.
Basic problem to solve:
Insert a new record if one (primary key) does not exist
Hey! For inserting/updating records in Bika based on your JSON data, here’s what usually works best depending on your scenario:
Single record via webhook → Use webhook trigger + add record action (for new entries) or find record + update record actions (for existing ones)
Small batch processing → Add loop actions around the single-record flow. The setup might feel tedious initially, but you only need to configure it once.
Complex data handling → Slot in “Run script” actions with Python for any special transformations/comparisons needed before DB operations
Large-scale updates → OpenAPI + custom scripts with batch processing would be better suited for heavy lifting
Quick note: Bika’s automation works great for workflow orchestration, but it’s not optimized for big data ETL-type operations. For massive datasets, you might want to consider external processing before hitting our API. Hope this helps you get rolling!
In the interest of all current and future subscribers it would helpful if the support crew started asking for user scenarios and creating examples from them.
In my case I’m able to receive json array as a webhook. In the next action step, I’m unable to properly configure the loop step. The select var for the loop does not allow me to choose an array based json as input to the loop
Could you please show a javascript code that looks up existing database for value A and value B …if found, update that record with data fround from above json structure, if no match then insert a new record
I was able to create a loop action after running a code action that basically took webhook data and assigned it to a variable.
I used that variable to create a loop action.
Still hoping to get an answer regarding syntax to access and update database via javascript/run script action. Does access to Bika db via run script exist? or would I need to make an api call as if sending request from outside of Bika?
Just wanted to say your workaround with the Run Script action upstream of the Loop Action is spot-on for now. Currently, the Loop Action can only read arrays generated by previous actions (not triggers), but we’ve logged this limitation and plan to improve it later.
For your second question: the Run Script action doesn’t have built-in functions to directly read/write Bika databases. You’ll need to use Bika’s Open API within the script by making HTTP requests (same as calling it externally). For super complex scenarios—like heavy data processing or large datasets—it’s better to handle those outside Bika to avoid memory/timeout issues.