-
BudiBase noob here, and by all means no more than a JS amateur. I've got an automation set up that takes an object from an external datasource, which I then try to process with Javascript.
I can make this work locally on my PC with this data as an object, and a line of JS that selects the right value. I also succeeded in Budibase in returning a value that gets filled back into the row. What I can't get to work though is how to pick up the object from step 1, and process that. I have tried in all kinds of ways to simply pull some data form the object, and return it to BudiBase, but all I get is 'Error while executing JS'. Most of what I tried is variations of this:
The first line by itself will execute without error. But the second line already causes a JS error. With that I am assuming the obj is not formatted or handled in the right way. No matter how I try to simplify steps to just get anything from the object to process, I keep getting 'Error while executing JS'. Given the lack of (as far as I know), options debug JS in budibase, I can't trace the steps. Any thoughts on what I might be doing wrong??
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
HI @sandbak This is the problem here:
Info is not an array. You'll need to do: Note the single quotes around the '0' in info |
Beta Was this translation helpful? Give feedback.
-
It appears that you need to use the info binding: This seems a bit strange given the binding descriptions, so I've raised a bug here: #6003 |
Beta Was this translation helpful? Give feedback.
-
Is there a way to get the actual JS error instead of the generic error? A server log maybe? |
Beta Was this translation helpful? Give feedback.
It appears that you need to use the info binding:
let IntentLabels = $("steps.1.info")[0].rows[0].IntentLabel;
This seems a bit strange given the binding descriptions, so I've raised a bug here: #6003