I added extension "Create records for multiple templates". I hooked it up to run when a button is pressed. It is working correctly.
But I would prefer for it to run auto once conditions are met. I know this can be done in automations with a scripting block. My question is - can I just copy and paste code from the extension into a scripting block for automation?
I tried, but I am seeing a lot of red. I assume I am misunderstanding the foundation of the code, or I am missing a step? Would adding something in the input variables to make this work?
Generally speaking, moving a script from a Scripting Extension to a Run a Script action within an automation is rarely a simple copy and paste.
The Scripting Extension has several input and output commands designed to ask a user a question or show a user something. Since the Run a Script action is autonomous, there is no need for the vast majority of those inputs/outputs and therefore none of them will work.
Rules of thumb when moving from the Scripting Extension to the Run a Script action step:
If you have specific questions about a specific script, its best to give a link to that script since very few of us here in the forums have every published script memorized or bookmarked.