# Reports break after Collection is Moved

**URL:** https://discourse.notenik.app/t/reports-break-after-collection-is-moved/395
**Category:** Uncategorized
**Created:** [January 18, 2024, 7:14am UTC](https://discourse.notenik.app/t/reports-break-after-collection-is-moved/395 "2024-01-18T07:14:49Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Malcolm](https://discourse.notenik.app/letter_avatar_proxy/v4/letter/m/e19b73/32.png) [@Malcolm](https://discourse.notenik.app/u/Malcolm)
#### Post date: [January 18, 2024, 7:14am UTC](https://discourse.notenik.app/t/reports-break-after-collection-is-moved/395/1 "2024-01-18T07:14:49Z")

</div>

This afternoon I moved a collection. I used the “File \> Move” command to perform the process. When I went to run a report - nothing happened. On investigating I realised that the report script was using a file path to specify the location of a report template. The file path was not updated when the files were moved.

Is it possible to use relative paths or to use system variables in the script files? I’m able to print `templateparent` and `dataparent` in the template but when I try to use system variables in the script I get errors. Here’s the output in the log file.

```auto
Starting to play script located at /Users/malcolm/Library/Mobile Documents/iCloud~com~powersurgepub~notenik~shared/Documents/WorkRecords/reports/query_script.tcz on 18/01/2024 at 8:08:03 PM
Setting maximum directory depth to 1
Initializing Collection
Collection: /Users/malcolm/Library/Containers/com.powersurgepub.notenik.macos/Data
This path does not point to a Notenik Collection
Problems opening the collection at /Users/malcolm/Library/Containers/com.powersurgepub.notenik.macos/Data
Field label of ticket could not be found in input source
Creating filter rule: ticket eq Artworks
0 Notes passed the filter rules
0 Notes were filtered out
Sort field label of title could not be found in input source
Creating sort field: ascending
Sort field label of ticket could not be found in input source
Creating sort field: ascending
Error reading Template from =$templateparent$=/query_template.html -- file:///Users/malcolm/Library/Containers/com.powersurgepub.notenik.macos/Data/
Template Read Error: Error Domain=NSCocoaErrorDomain Code=260 "The file “query_template.html” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Users/malcolm/Library/Containers/com.powersurgepub.notenik.macos/Data/=$templateparent$=/query_template.html, NSUnderlyingError=0x600000d68300 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
Template not ready for output generation!
0 lines read from template file
Script execution complete on 18/01/2024 at 8:08:03 PM

```

---

<div class="post-metadata">

### Author: ![hbowie](https://discourse.notenik.app/user_avatar/discourse.notenik.app/hbowie/32/6_2.png) [@hbowie](https://discourse.notenik.app/u/hbowie)
#### Post date: [January 18, 2024, 10:13pm UTC](https://discourse.notenik.app/t/reports-break-after-collection-is-moved/395/2 "2024-01-18T22:13:55Z")

</div>

Although Notenik doesn’t do this automatically, you can specify relative paths in the following way (see [Knowledge Base](https://notenik.app/knowledge-base/EPUB/html/script-file-columns.html)).

When the value column contains a path to a folder or a file, then a relative path may be indicated by specifying a prefix of `#PATH#`. The resulting path will be resolved relative to the location of the script file currently being executed.

As examples:

- `#PATH#../` would resolve to the folder 1 level above the location of the script file.

- `#PATH#templates/page_template.html` would resolve to the file named `page_template.html` located in the `templates` folder, assuming the `templates` folder is located in the same parent as the script file itself.

- `#PATH#../templates/page_template.html` would resolve to the file named `page_template.html` located in the `templates` folder, assuming the script is located in something like a `scripts` folder that is a peer to the `templates` folder.
