Hi,
Our team is looking into using DatoCMS for our new website project. Currently, all our website content is generated and structured in Airtable. Therefore, we are looking for a setup where we can integrate Airtable content into our CMS.
When we generate new content in Airtable, we want to create a new record in DatoCMS. I saw that Dato has recently launched a feature for converting Markdown to structured content, but what about the other way around?
Our marketing setup is currently Airtable and Make. Does anybody have experience with a similar setup approach, since we would not actively be managing content in Dato, but as much as possible externally through the systems that we already use. Is it possible without a serverless function to convert Markdown to structured text when we create new records?
On the Markdown and Structured Text part: Structured Text is not stored as Markdown on the API, itâs stored as a DAST JSON document (spec here: https://www.datocms.com/docs/structured-text/dast). So if you create records via API and the target field is Structured Text, you need to send valid DAST JSON, not a Markdown string.
If your team is already authoring Markdown in Airtable and you do not need Structured Text features like embedded blocks and record links, the simplest approach is to use a multi paragraph text field configured to use Markdown. That way you can send the Markdown straight through from Airtable with no conversion step at all (see âMulti paragraph Textâ here: https://www.datocms.com/user-guides/content-modeling/intro-to-string-text-fields).
If you do want to keep Markdown in Airtable but store it in a Structured Text field in DatoCMS, the conversion has to run somewhere before you call the CMA. We provide conversion utilities as libraries (the âMigrating Markdown contentâ section shows the typical approach: https://www.datocms.com/docs/structured-text/migrating-content-to-structured-text and the underlying package is https://www.npmjs.com/package/datocms-html-to-structured-text), but the CMA itself does not automatically convert Markdown into Structured Text for you. So unless you can run that conversion code inside Make (which is often tricky if you need npm dependencies), youâd normally add a small code step somewhere (a lightweight serverless function or any tiny service) to do Markdown to DAST and then POST the result to Dato.
Thanks for your quick reply. That makes sense, and we would really like to avoid setting up edge/serverless functions to minimize technical overhead for the marketing team.
We are currently trying to build our own script in Airtable to convert Markdown into the JSON structure required for the DAST format. We also plan to maintain a mirrored table for the media library in both Airtable and DatoCMS, so we can store the correct corresponding DatoCMS IDs for media assets when our rich content is created.
I hope this approach will work well. Otherwise, as you mentioned, the way forward would probably be to set up a small serverless function
But also, I suppose I should ask what your intended architecture here is, at a higher level. If Airtable is your source of truth, what is the reason for wanting to clone it into Dato too? (Like, why sync it at all, either one-way or both ways?)
They can both act as content repositories, so in a way theyâre both doing the same thing. Another option you can consider is, for example, having your frontend fetch from both systems separately and then combining them (itâs all headless, after all). In Dato, if you want your editors to be able to see your Airtable stuff, that could be a simple plugin or even an iframe of the published Airtable data.
It just depends on how you envision these two systems working together, both for the machines (your API and frontend) and the humans (your editors)⌠happy to discuss more if helpful, but if you already know what youâre doing, donât let me stop you
If youâre not going to be doing edits in Dato, why even convert to Structured Text? We do natively support Markdown fields, so you can directly sync the Markdown into your Dato records if thatâs easierâŚ?