Is there a way I run a Query List object Date column against a single line variable type?

  • 22 October 2014
  • 1 reply
  • 2 views

Badge +3

I am in the process of creating a workflow for our Tuition Reimbursement program that would query all items the requestor has submitted within the year and based on that collection, calculate the total amount of tuition fee for that year. If it is less than the max reimbursement amount the workflow will kick off an approval workflow. If not, it will automatically decline the request.

Using the Query List object, the workflow will work if I create 2 Date and Time variable and set a static date of each (BeginOfYear = 1/1/2014 and EndOfYear = 12/31/2014) querying all items that have a start date between the 2 variables.

The issue that I am having is trying to programmatically set the date range to the current year. In essence, the workflow will automatically set the year of the Date and Time variable to 2015 at the beginning of next year.

I currently have an expression builder to capture the year from the course start date field then store it into a single line variable type called YearTemp. I have 2 other single line variable types that will set the value of BeginOfYear and EndOfYear to "1/1/YearTemp" and "12/31/YearTemp" respectively. Used these variable against the course Date field within the Query List object and get to results. I have tried using the following values for the BeginOfYear and EndOfYear variables - "1/1/YearTemp 12:00 AM" and "1/1/YearTemp 12:00:00 AM".

Am I using the wrong approach to accomplish this? Or am I using the wrong values for the date variables? Any suggestions or input is greatly appreciated.


1 reply

Badge +3

Nevermind. I found another solution for this. Created a year column at the list level. Used the same expression builder to extract the year and updated the year column. In the Query List object, I just queried the employee name and the year field.

Reply