Overwrite existing file object

Hi Siri,

Thank you for your question! It is intended behaviour that users are prevented from overwriting existing file objects. Here is a step by step guide to how I have been able to get this process to work:

  1. Add a runtime property to Image Return RT called “Reference”, with type Boolean.
  2. Set up an “On View Load” action for the View which shows the images. First, read the required images to Image Return RT as you were doing before. Then, iterate each image in Image Return, and create a new file object in Image Return RT using the process outlined here to duplicate file objects. Make sure that the “Replace Existing Objects” checkbox is NOT enabled. For each of these file objects created, assign the runtime property “Reference” to true. Now, some items in Image Return RT will be “copies” of the original images, while some are direct references.
  3. Set up the UI in the View so that it only shows the user the images with “Reference” set to true. Users can draw on these images as before.
  4. When saving and persisting, you can persist a filtered selection of objects (those with “Reference” set to true). Then, iterate through the items in Image Return RT where “Reference” NOT EQUALS true, and for each one, delete the item in Image Return with matching ID.

This will persist the edited versions of the images to the server, and then delete the original versions stored on the server afterwards.

Let me know if there’s any questions, or if you need any help with this setup :slight_smile: