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

Question

Question

Improvement Request: Introducing a 3rd variable class. [YYYY]

asked on March 23, 2016

In Forms there are basically 2 Variable classes, Process variables and field variables. a third variable able to be used in all forms created like [YYYY]/[MM]/[DD] etc.

i think the use case is self explanatory, but as an example to be able to use a [YYYY] variable that will pick the current year and apply it in the 'Save to Repository' task would assist.

2 0

Replies

replied on March 24, 2016

Michael,

I think this is a great idea.

If you're trying to work around this in the meantime, I currently deal with this issue in one of 2-ways.

1. Creating a hidden date field on my forms with a default value of now. I then use some javascript to populate a hidden text field that will contain the year. Example below. 

$(document).ready(function() {
  updateYear();
});

function updateYear() {
  sourceField = $('[attr="date"] input');
  sourceValue = sourceField.val();
  targetField = $('[attr="year"] input');
  targetValue = (new Date(sourceValue)).getFullYear();
  targetField.val(targetValue);
}

2. After saving to the repository, I invoke a workflow that adjusts the name, path, etc. as needed using the current date. Here's an example of the Assign Token task using the global Date variable.

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

Sign in to reply to this post.