Help

Re: Help with a script please!

Solved
Jump to Solution
4082 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Dennis_Petrou
7 - App Architect
7 - App Architect

Hello. Let me preface this by saying I am not great at scripts, so your patience and clear explanations would be greatly appreciated.

We currently have a script (no idea who wrote it ages ago) in one of our tables that works by the pressing of a button. I am trying to get the same script to work by triggering it with a checkbox so I can use it in an automation. Thinking I could just copy/past the script, but that clearly doesn’t work. I get the error :
TypeError: input.recordAsync is not a function
at main on line 2

I know I have to make some changes for it to work properly, I’ve seen similar responses but couldn’t figure out exactly what to do. The original working script that is currently triggered by a button is:

let mapperschedule = base.getTable("Mapper Schedule");
let record = await input.recordAsync('Pick a record', base.getTable('Mapper Schedule'));
let topaste = record.getCellValue('Update Mapper Schedule Name - To Paste');
let name = record.getCellValue('Name');

output.markdown(topaste);

if(topaste!=""){
    await mapperschedule.updateRecordAsync(record.id,{
        'Name': topaste
        
    });
}

output.markdown('# Done!');

Any help would be greatly appreciated!

10 Replies 10

thanks so much for all your help!