# Increment Filename if File exists

**URL:** <https://community.automationedge.com/t/increment-filename-if-file-exists/4784>\
**Category:** Process Studio\
**Created:** [September 20, 2021, 2:39am UTC](https://community.automationedge.com/t/increment-filename-if-file-exists/4784 "2021-09-20T02:39:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmr](https://avatars.discourse-cdn.com/v4/letter/j/d6d6ee/32.png) [@jmr](https://community.automationedge.com/u/jmr)\
**Post date:** [September 20, 2021, 2:39am UTC](https://community.automationedge.com/t/increment-filename-if-file-exists/4784/1 "2021-09-20T02:39:24Z")

</div>

Hi

How can I increment the filename if the file already exists on the folder?  
What should I write on the modified java script step?

thanks, really appreciate the help

---

<div class="post-metadata">

**Author:** ![KalyaniW](https://avatars.discourse-cdn.com/v4/letter/k/71e660/32.png) [@KalyaniW](https://community.automationedge.com/u/KalyaniW)\
**Post date:** [September 23, 2021, 5:03am UTC](https://community.automationedge.com/t/increment-filename-if-file-exists/4784/2 "2021-09-23T05:03:08Z")

</div>

Hello @jmr

You can add DateTimeStamp to the file using Modified JavaScript and then pass the new filename to the ext step.
