# Dynamic URL Path Based on MetaData

**URL:** <https://forum.cloverdx.com/t/dynamic-url-path-based-on-metadata/1596>\
**Category:** CloverDX Platform\
**Created:** [March 6, 2015, 12:00am UTC](https://forum.cloverdx.com/t/dynamic-url-path-based-on-metadata/1596 "2015-03-06T00:00:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![laurafbh](https://avatars.discourse-cdn.com/v4/letter/l/bc8723/32.png) [@laurafbh](https://forum.cloverdx.com/u/laurafbh)\
**Post date:** [March 6, 2015, 12:00am UTC](https://forum.cloverdx.com/t/dynamic-url-path-based-on-metadata/1596/1 "2015-03-06T00:00:00Z")

</div>

I having an issue with something that should be simple, but I can’t find any documentation on it.

I have an Email Reader which is pulling out an attached file and posting the file to a new directory. I would like the directory to be dynamic based on the subject line of the email. For example:

Subject: client

Post the file to: [abc.com/client/incoming/#](http://abc.com/client/incoming/#)

I am saving the Subject as metadata and also writing it to a text file. Is there an easy way to either reference the metadata in the URL string or create a parameter from the metadata so it can be used in the URL?

Thanks,  
Laura

---

<div class="post-metadata">

**Author:** ![imriskal](https://avatars.discourse-cdn.com/v4/letter/i/b38774/32.png) [@imriskal](https://forum.cloverdx.com/u/imriskal)\
**Post date:** [March 10, 2015, 2:29pm UTC](https://forum.cloverdx.com/t/dynamic-url-path-based-on-metadata/1596/2 "2015-03-10T14:29:43Z")

</div>

Hi Laura,

This is easily possible using [partitioned writing](http://doc.cloveretl.com/documentation/UserGuide/index.jsp?topic=/com.cloveretl.gui.docs/docs/partitioning-output-into-different-output-files.html).

Example:

File URL: ${DATAOUT\_DIR}/#/email.txt  
Create directories: true  
Partition key: subject (The name of your metadata field)  
Partition file tag: Key file tag

I hope this helps.
