I am attempting to setup a workflow for a Callback system for my Sales calls. My plan was that when a record in my Callback List View inside my Touchpoints table was updated to have the Call Result column be set to Voicemail select - that it would automatically duplicate itself and the duplicate would have 24 hours added to the Start Date/Time column - so that I would automatically see that record the next day in the Today's Calls View in the Touchpoints table.
My challenge is that I am unable to find a way to duplicate a record based on the ID - so far I have created an automation and passed the record id as 'rec_id' variable to be accessed through the input.config() variable in the script that is set to run when my Trigger matches as per this screenshot:
https://share.getcloudapp.com/p9uL4eKP
After reviewing some other examples of scripts I have created a script which you can see in the Gist below:
https://gist.github.com/HeadStudios/98c8837c02a0fb8540e3e36333281945
While this script does not work - I feel it at the very least outlines what I am attempting to achieve quite well. Pardon my ignorance as JS is not my first programming language.
While my script doesn't report any errors - I am unable to detect any new rows created.
Any input on my challenge would be much appreciated.
P.S. As an aside the script takes 12 seconds to run - so any input on speeding it up would be much appreciated also. Thanks!