# Copy and paste (of unchanged) Template Canvas data via Dataset Viewer results in corrupted object

**URL:** <https://forum.inductiveautomation.com/t/copy-and-paste-of-unchanged-template-canvas-data-via-dataset-viewer-results-in-corrupted-object/45838>\
**Category:** Ignition\
**Tags:** vision, ignition79\
**Created:** [April 20, 2021, 11:18pm UTC](https://forum.inductiveautomation.com/t/copy-and-paste-of-unchanged-template-canvas-data-via-dataset-viewer-results-in-corrupted-object/45838 "2021-04-20T23:18:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![filipg](https://avatars.discourse-cdn.com/v4/letter/f/a88e4f/32.png) [@filipg](https://forum.inductiveautomation.com/u/filipg)\
**Post date:** [April 20, 2021, 11:18pm UTC](https://forum.inductiveautomation.com/t/copy-and-paste-of-unchanged-template-canvas-data-via-dataset-viewer-results-in-corrupted-object/45838/1 "2021-04-20T23:18:38Z")

</div>

I am using Template Canvas to provide a list of simple document-link templates (for user to select from list of documents to open in a popup, for PDFviewer object to then open). I manually created four (4) rows using right-click → Customizers → Template Canvas Customizer. This works okay, however one can’t really insert rows or modify row order from this interface (that I know of).

So, I tried to get at the object data via Property Editor → Data → Templates (as shown in [tutorial video](https://docs.inductiveautomation.com/display/DOC79/Template+Repeater)) and then I pull up the Dataset Viewer window and use Copy to Clipboard button.

When I create a copy of my Template Canvas object and repeat above, but instead use Paste from Clipboard (without changing clipboard in ANY way), the object is corrupted. I need assistance to understand why that is and how to work around it.

I saved contents of the clipboard/Template Canvas to file, below:  
[template\_canvas\_that\_wont\_paste.txt](https://forum.inductiveautomation.com/uploads/short-url/1t0scLpWC0JuuD1gM2TF4KUiRT2.txt) (1.6 KB)  
It looks like rows are preserved but data is lost during pasting operation. Here’s what they look like side by side:

 ![original_and_corrupted_objects](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/9/d9e3d2154b9e1303fb2ed7cc9349afa9b77f8dc7.gif)

Underlying template is very simple:

 ![document_template_view](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/b/db3d34035d2dcc9641c2a20e499e4af1a92c31f0.gif) ![document_template_properties](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/8/c812795482edbc690b919207ffb760e5efae456c.gif)  
(background color is white for category=true or grey otherwise)

I’m on 7.9.12 (b2019070213), under Windows 10 enterprise.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [April 21, 2021, 5:10pm UTC](https://forum.inductiveautomation.com/t/copy-and-paste-of-unchanged-template-canvas-data-via-dataset-viewer-results-in-corrupted-object/45838/2 "2021-04-21T17:10:37Z")

</div>

The problem is the backslashes in your Path parameter are being treated as escape sequences, because for some reason they’re not being properly escaped. I can’t reproduce in 8.1.X; this might be a fixed bug. If you upgrade to latest 7.9, there’s changes made to how the JSON encoding is done for the custom properties that may have been what fixed this.

---

<div class="post-metadata">

**Author:** ![filipg](https://avatars.discourse-cdn.com/v4/letter/f/a88e4f/32.png) [@filipg](https://forum.inductiveautomation.com/u/filipg)\
**Post date:** [April 24, 2021, 6:25pm UTC](https://forum.inductiveautomation.com/t/copy-and-paste-of-unchanged-template-canvas-data-via-dataset-viewer-results-in-corrupted-object/45838/3 "2021-04-24T18:25:47Z")

</div>

Unfortunately, updating to 7.9.17 didn’t fix issue.

Curiously, every time I “Paste from Clipboard” in Template Canvas → Dataset Viewer, it blindly truncates 2 back-slashes (this is repeatable) , until none are left and then it throws up a “java.io.IOException: CSV invalid: row #2 has incorrect column count. Found 16, expected 8.”

I can ‘game’ “Paste from Clipboard” by simply doubling # of back-slashes (paste operation blindly halves the count) but doesn’t work for repeat operations.

Likely, I will swap to “/” and then use a script to rewrite the path before “using” it.
