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

Question

Question

Calculate a Year in the Future (Different for every record)

asked on June 3, 2022

I'm 90% of the way on this one, after reading the forums here, but I'm stuck on one last piece.  

I'm scanning a document in via Quickfields.  These are report cards, and depending on the Grade of the student I want to calculate the year they should graduate.  I've got the grade as a token, and I've combined the grade and -12 in a multi token so I can use "Sum" to figure out how many years are left.  But - because (Grade - 12) is negative, when I combine with the current year, the answer is in the past.  

I've tried adding -1* before the token to get it to change from negative to positive when I assign the value to the token, but that just seems to turn it into text and it does not calculate.  

 

As per the screenshot below, using Sum is sort of working.  Is there some way to use operators on Tokens?

 

Alternatively, given that the potential number of years is limited, I could do a series of conditionals to create a token.  But I'm lazy, and this seems easier.

 

0 0

Replies

replied on June 3, 2022

What?  Say it ain't so - you can't nest conditionals???

0 0
replied on June 3, 2022

You could use Quick Fields to start a Workflow upon storing the documents, and then have Workflow retrieve the year, do the calculation (Token Calculator activity), and then assign the field value.  It'd be nearly instantaneous with storing the document.

You could probably also hack this to work by using Pattern Matching (e.g., "\d+") to remove the minus sign of the token value.  Simpler, but not as robust.

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

Sign in to reply to this post.