Hello everyone! I have created a new scripting extension which allows you to convert formatted text in your rich text fields into markdown!
The extension will look through all the records in the table you have selected and convert the selected field's text into markdown so that you can use it for your email, Slack, etc automations
Please feel free to reach out to me if you have any questions or feedback!
Installation instructions:
1. Click "Extension" at the top right
2. Click "Add Extension"
3. Click the "Scripting" extension
4. Click "Add Extension"
5. Paste the code below in!
let settings = input.config({
title: `Convert rich text field to markdown`,
items: [
input.config.table("table", { label: `Table` }),
input.config.field("richTextField", { parentTable: `table`, label: `Rich text field` }),
input.config.field("markdownField", { parentTable: `table`, label: `Output field` }),
],
});
let { table, richTextField, markdownField } = settings;
let query = await table.selectRecordsAsync()
let updates = new Array
query.records.forEach((record) => {
updates.push({
id: record.id,
fields:{
[markdownField.name]: record.getCellValue(richTextField.name)
}
})
});
while (updates.length > 0) {
await table.updateRecordsAsync(updates.slice(0, 50));
updates = updates.slice(50);
}