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

Question

Question

Update Number of Days field based on Date

asked on April 12, 2018 Show version history

Good afternoon,

I've been tasked to put together a process in which a date is given and then there should be a reminder 90 days in advanced. So far so good, I'm using a Date Token Calculator to calculate the date and do my thing. 

When the Date finally meets the criteria, then it goes into a branch where the "Number of Days" field is updated to 30, and then when the date finally meets the criteria again, then the "Number of Days" filed is updated to...say 15, and then 10 and then 5 and then 4,3,2,1,0

As you might be predicting, I'm creating a reminder for those dates. I have a branch with a condition to meet the criteria and once the criteria is met, then updates the number and on to the next branch and so and so. 

Of course, event though it works, I'm looking for a more programmatic way to approach this. As I see it, I would have to make the "Number of Days" field read-only, otherwise the criteria would never be met if someone changes it, as it is hard-coded in metadata. Another problem would be if I want to add more criteria, like, 1 year, 6 months, 3 months, etc. It would become hard to maintain. It doesn't have to be a set number of days it could be calculated in weeks, moths, days combination, as long as it is scalable.

Any ideas on how to take the next step to improve this branch?

 

Thank you,

Raul Gonzalez

ComparingBranch.PNG
0 0

Replies

replied on April 12, 2018

Hi Raul

You can do this with a deadline in a repeat loop. The deadline will cancel the primary branch where the wait condition resides. Your repeat function will run again and calculate a new date based on the previous notification. The same wait condition will still be set. Repeat until you give up reminding them (and do something else) or until the task is complete.

0 0
replied on April 12, 2018

Are you sending different emails depending on the numbers of dayes left? Or is the number the only thing different in the email message? If the latter, then you don't need any of those branches.

Maybe you can give more details on what the end goal is? Because it doesn't sound like you should need to keep track of how many days are left if you only need to email.

0 0
replied on April 16, 2018

Thanks Miruna,

I'm sending emails depending on the number of days left. People can have different dates and days before notification. Example: two people.

First person: 

Due Date: 5/20/2018

Number of days before notification: 90

 

Second Person:

Due Date: 6/15/2018

Number of days before notification: 30

 

So I managed to handle it with the Date Token Calculator. Now to expand its functionality I wanted to check if an action was taken in repository, let's say that something is no longer "In Progress" in repository, so now no more notifications go out, but if still "In Progress" then the next notification would be 30 days and then maybe 15 and then a week before and then every day. Something similar to that. I'm not married to that exact set of ranges.

What do you think?

I tried the "Deadline" activity that Chad suggested, but it seems to hang waiting in the first run so I have not managed to make it work. I can make it work if there was only one person to remind, but there are like 50 people, all with different Remind Dates, so I still need to figure out how to run thru all of them without having the Deadline activity just sit there and wait.

0 0
replied on April 16, 2018

Yes, Chad's example is handling your original description which sounded like you need to send a notification and then wait for the next notification date.

Where do you keep the list of people and their preferred notification settings?

0 0
replied on April 16, 2018

Miruna,

I have the list of people in folders in Repository and the notification settings are just based on the End Date field and the Days Before End Date field. So in the example of the screenshot below, the notification would have gone today if Status remained "In Progress". After that, I would update the Days Before End Date field to some other number so that the person that got reminder can get reminded again... unless the status is no longer "In Progress"

 

rep1.PNG
rep2.PNG
rep1.PNG (2.76 KB)
rep2.PNG (15.48 KB)
0 0
replied on April 16, 2018

You could have Date Token Calculator figure out what 90 days from today is, then search for the documents with status "in-progress" and end date "7/15/2018". Then go through the results and send email.

Do you need to log when the next notification should out? Or was that just a way to keep track that you sent one?

0 0
replied on April 16, 2018 Show version history

I have the Token Calculator in place, and it just calculates the Days Before End Date field vs the current date. If they match it sends out the email and updates the Days Before End Date to the next Days Before End Date number. The "End Date" field does not change; that's the date the contract would end.

I just thought that maybe I could do this without so many branches.

TC.PNG
TC.PNG (19.88 KB)
0 0
replied on April 16, 2018

Right, but this is inefficient because you have to get all documents, then check if there should be a notification sent out today. Calculating the date before you search would allow you to get only the documents that need notifications sent out today.

0 0
replied on April 16, 2018

Thanks Miruna,

So If my Search is only set to search for all those folders in which the status is "In Progress" does that make a difference?

How can I calculate the date before you search, if you don't have the value for the Days Before End Date field?

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

Sign in to reply to this post.