File Object Class edit/subscribe to updates/persist. How to keep file content updated?

Hi, I am having some trouble choosing the correct method for the case of editing and previewing a PDF document. I have a file object class with a string attribute “HTML body”. This HTML content is edited using a text editor/coded component. On Save click I want use the regenerate the PDF file and preview it with changes.

The problem I am having is that generate file generates a new file object. My expectation was that it would update the file content only.

Due to this I was wondering how handeling file edititing should be handled? Is it recomended to have 2 object classes. One file and one regular where the regular contains the information and the file object class is regenerated each edit. Or is it fine to have one file class with all attributes and making sure that both attributes and file content on the new file object is updated with the old one.
I am assuming that i need to delete the old file object each edit, is that correct?

Lastly, if it is technically possible to have a toggle on “Genereate PDF-file” that says “replace object” similar to the regular object class. That would make file editing more similar to the regular object class editing and would have saved me some confusion in this case :slight_smile:

Hi Sondre,

Unfortunately, this is not possible at the moment. If you wish to update an existing File Object in Create, you must create a new file and then update the references and pointers to the new file. The same approach applies to the Generate Document action node.

However, I have initiated a new challenge with a request to add “Update existing” on File Object Classes and Generate Documents with a cardinality of one.

1 Like

Thanks for the info an new challenge :slight_smile:

Then I am going for a supplement object class approach so that I don’t have to keep track of all the attributes each delete/create iteration :slight_smile: