How to check in worknotes everyday for a specific text
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2023 12:37 PM
Hi,
Here is the situation:
A notification is sent to a user to answer to renew or not an application access.
When the user answers, it saves information into the worknotes. If the answer is to renew, it will be renewed for a max of 90 days.
We give 7 days to user to answer.
So, I'm looking a way to check every day and for the next 7 days for a specific text in the most recent worknotes.
If it meets the condition it will do something otherwise something else.
I already use a script to look for in the previous worknotes but I was using a 7 days timer and it is causing an issue because the system is adding a worknotes saying that the request was in pending then it fails for IF condition to find the specific text in the previous worknotes.
The reason why to search in the previous worknotes, is because it is possible that it is not the first time that the user renew the application access, so I don't want to look to all worknotes.
Your help will be much appreciated.
IF Condition in a Workflow:
answer = ifScript();
function ifScript() {
// Look in the last filled work notes box
var notes = current.work_notes.getJournalEntry(1);
// Check if last work notes contain words: please extend expiry date
if (notes.toLowerCase().indexOf("please extend expiry date") > -1){
return 'yes';
}
// Check if last work notes contain words: please deactivate/withdraw
if (notes.toLowerCase().indexOf("please deactivate/withdraw") > -1){
return 'no';
}
}
Thanks
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2023 12:41 PM
Hi,
You can add a Timer condition for 7 days and then you can us the if condition to do the check that you are currently performing using above.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2023 12:45 PM - edited 10-30-2023 12:50 PM
No, I want to avoid the timer, it causes issue to have the system writting that is was in Pending... and this worknotes becomes the most recent worknotes. Looks like that the time is consider to be in pending, so after 7 days, it writes "blabla" was in Pending..
Thanks