Issue - output.markdown in automation

Topic Labels: Scripting extentions
1870 2
Showing results for 
Search instead for 
Did you mean: 
5 - Automation Enthusiast
5 - Automation Enthusiast

hoping for some help/feedback on the following error. below the error i’ve pasted the portion of my script getting the error. The script was copy/pasted from a scripting block into an automation script. i ran a compare and the script is identical to the scripting block script:

TypeError: Invalid arguments passed to output.set(key, value):
• value should be a JSON-serializable type, not undefined

  • at main on line 27*

21 const query = await new_submissions.selectRecordsAsync();
22 if(query.records.length === 0) {
23 output.markdown(“No submissions to load. Done.”);
24 return;
25 }
27 output.markdown(Found *${query.records.length}* submissions);
28 for(var i in query.records){
29 let r = query.records[i]

any help would be appreciated

2 Replies 2
7 - App Architect
7 - App Architect

Unfortunately, the automations don’t allow any of the output functions to work. Automations run in the background of your base, meaning that you won’t see these automations running, and therefore wouldn’t see any messages associated with the script running.

If it’s a matter of testing your script, you can still use console.log() in order to see the results of different parts of your script.

I would suggest, removing the output functions and keeping only the portions of your script that make changes to your base.

Hope this helps. Good luck!

helps a ton. Thanks Sam!