You are viewing limited content. For full access, please sign in.

Question

Question

Current Month and Year in Save to Repository Service Task

asked on January 8, 2017

During my Save to Repository Service Task, where I am setting the folder location to store my form and its attachments, I need to be able to set the file path by year and month.

i.e.   Main\Accounting\Reimbursements\2017\2017-01

Does anyone know how to break out the month and year of a date in the folder path and file name like this?

0 0

Answer

SELECTED ANSWER
replied on January 9, 2017 Show version history

Currently, In the Form you would need to create an extra Single Line Field for Year and Month.

In the Year field, put the Formula =Year(DateField), for the Month field =Month(DateField)

You can then Hide these fields so they are not displayed with Field Rules or JS, but they can be used for assigning their values in your Folder Path or MetaData Fields

1 0

Replies

replied on January 9, 2017

Thanks @████████- that worked!

I wanted a leading zero on the month, so I ended up doing the formula like this
=RIGHT(CONCATENATE("0",MONTH(current_date)),2)

I do still wish there was a way to do this right in the Process Diagram instead of having to do even more hidden fields (1 for current_date, 1 for the year calculation, and 1 for the month calculation) - but I guess really, what's three more hidden fields when I already have a couple dozen?

1 0
replied on January 9, 2017 Show version history

Me too, I've asked about that before myself. Post a feature request for it. The more voices in the choir the better.

2 0
replied on January 9, 2017

There may be a seamless way to do this within Forms (Javascript maybe) but a simpler solution would be to use Workflow to do this for you via pattern matching/Regex and the route to folder activity.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.