@Chr1sG had helped me before with a similar request. Here is a possible solution:
- Create all the simple text fields that you want the information inside.
- Create a button to execute the following script:
const fibery = context.getService('fibery');
for (const entity of args.currentEntities) {
const entityWithExtraFields = await fibery.getEntityById(entity.type, entity.id, ['RichTextFieldName2','RichTextFieldName3','RichTextFieldName4']);
var doc1 = await fibery.getDocumentContent(entityWithExtraFields['RichTextFieldName1']['Secret']);
if (doc1) {doc1 = doc1.replace(/\n\n/g,'\n')};
var doc2 = await fibery.getDocumentContent(entityWithExtraFields['RichTextFieldName2']['Secret']);
if (doc2) {doc2 = doc2.replace(/\n\n/g,'\n')};
var doc3 = await fibery.getDocumentContent(entityWithExtraFields['RichTextFieldName3']['Secret']);
if (doc3) {doc3 = doc3.replace(/\n\n/g,'\n')};
var doc4 = await fibery.getDocumentContent(entityWithExtraFields['RichTextFieldName4']['Secret']);
if (doc4) {doc4 = doc4.replace(/\n\n/g,'\n')};
await fibery.updateEntity(entity.type, entity.id, {'SimpleTextFieldName1': doc1 , 'SimpleTextFieldName2': doc2 , 'SimpleTextFieldName3': doc3 , 'SimpleTextFieldName4': doc4 });
Just replace RichTextFieldname1-4 and SimpleTextFieldName1-4 in the code with the correct field names.
- Run the button on all needed entitites (try on individual entitites first)