Skip to main content

Hello!

If I want to add a checkbox to a rich text field I simply type [] and checkbox appears.

But the same does not seems to work over scripting. I tried all kinds of combinations of `[] ` and `- [ ] ` and so on with no success.

```

let formattedInstructions = instructions.map(instruction => `- [ ] ${instruction}`).join('\n');
```

Maybe it's not possible right now?

Thank you!

As of now, Airtable's rich text field does not support rendering checkboxes through scripting or Markdown-like syntax (e.g., [], - [ ]). The checkboxes that appear when typing directly into a rich text field are part of the WYSIWYG (What You See Is What You Get) editor functionality and aren't replicated when using scripts or formulas.


Thanks @Saravanan_009, good to have this confirmed. Seems like two different markdown implementations are at play here - one on the backend, another on the client. Good to keep this in mind.


Hello @Martin_Malinda 
I've already implemented that. It works with a checklist.

Use automation script and then strictly follow spacing and format then it works perfectly fine.
See this specific example I've created for strings and arrays.

let inputConfig = input.config();
let recId = inputConfig.recId;
// Uncomment this and fetch record using this and transform the data string
//let table = base.getTable("Your Table Name");
//let record = await table.selectRecordAsync(recId);
//console.log(record);
let testmode = "string"; // Change this based on your mode
let checklistArray = [{ value: "Check 1", "status": false }, { value: "Check 2", "status": false },
{ value: "Check 3 Checked", "status": true }];
let checklistString = `[ ] Check 1\n[ ] Check 2\n[x] Check 3\n[ ] Check 4`;
if (record) {
let fields = [];
if (testmode == "array") {
checklistString = "";
for (let item of checklistArray) {
if (!item.status) {
checklistString += `[ ] ${item.value} \n`;
} else {
checklistString += `[x] ${item.value} \n`;
}
}
}
fields["Text CheckBoxes"] = checklistString
// @ts-ignore
let updateRecord = await table.updateRecordAsync(recId, fields);
//console.log(updateRecord);
}

I've also tested this it working fine for me.
Come up with your implementation if you still have issues.

👍


Ahh, this is good to hear, thanks @dilipborad! I tried different formats with no success, but I'll try your example and make sure the spacing is correct 🙏


Hello @Martin_Malinda 
This has already been tested on my side.

👍

 


Reply