Help

Re: Toggle checkbox with Script

Solved
Jump to Solution
1968 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Damian1
5 - Automation Enthusiast
5 - Automation Enthusiast

I was wondering if there’s any script that allow me to check/ uncheck the box? I can only do one but I want to make a toggle checkbox.

This is the script for check only

let table = base.getTable("Product List");
let record = await input.recordAsync("Interest", table);
let recordId = record.id;
await table.updateRecordAsync(recordId, {
    "Interest" : true,
})
1 Solution

Accepted Solutions
Tom_Keysers
6 - Interface Innovator
6 - Interface Innovator

Try getting the current value of that record’s checkbox field and just inverse it using !.

Something like this (untested code):

await table.updateRecordAsync(recordId, {
    "Interest" : ! record.getCellValue("Interest"),
})

See Solution in Thread

2 Replies 2
Tom_Keysers
6 - Interface Innovator
6 - Interface Innovator

Try getting the current value of that record’s checkbox field and just inverse it using !.

Something like this (untested code):

await table.updateRecordAsync(recordId, {
    "Interest" : ! record.getCellValue("Interest"),
})

Thank u so much. It works perfectly.