HI - I’m writing a JS routine to copy projects within a space. I can copy the main description field for an entity, but the copied version only contains unformatted text.
Does anyone have a sample of the code to copy both the text and the formattng? I’ve been using a snippet @Yuri_BC wrote for what appears to be markdown:
async function fetchDocumentContent(documentSecret) {
if (!documentSecret) {
return null;
}
return await fibery.getDocumentContent(documentSecret, 'md');
}
let descriptionContent = null;
if (entity[SOURCE_DESCRIPTION_FIELD] && entity[SOURCE_DESCRIPTION_FIELD].Secret) {
descriptionContent = await fetchDocumentContent(entity[SOURCE_DESCRIPTION_FIELD].Secret);
}
// Set the 'Description' content for the new entity
if (descriptionContent) {
await fibery.setDocumentContent(newEntity[TARGET_DESCRIPTION_FIELD].Secret, descriptionContent, 'md');
}
Is there any documentation that spells out what is supported? I use callouts extensively, but if there is an alternative, I can switch to supported rich text.
Can you please confirm if the above code is correct for rich text? This seems to be specific to markdown: await fibery.setDocumentContent(newEntity[TARGET_DESCRIPTION_FIELD].Secret, descriptionContent, 'md');
I don’t think we have anything in our user guide. Will add it to the to-do list
The code looks to be syntactically correct, but the ‘md’ option is just one of several (the others being ‘html’ and ‘json’) and if you’re copying within Fibery the html option supports more formatting options than markdown I believe.