Using Flow Designer or Scheduled Job

aj_becker
Tera Guru

Hello, 

I have been working on a solution to a problem we are having.  The current process in place to terminate users is that when a custom field on the user table (termination date) changes and is not empty, a BR will run that creates a termination catalog item.  This works as designed.  The issue that we are having is that termination dates can change multiple times before they are terminated, which is creating multiple of the same requests.  I have decided of two solutions but can't finish either because of my knowledge.

Solution 1: I have created a FLOW from flow designer that will run every day at specific time.  In that flow it will look at users with there term dates of being yesterday(day after termination), and it will create a req, ritm and all of the tasks needed to term the employee.  I have tested this and this works as intended except for one issue.  I cant fill the variable fields with the information needed so our techs will get blank tasks.  Question is: Is there a way in FLOW designer to populate variables from the user table?

 

Solution 2: Create a schedule job that will be schedule to run once a day to pull all users that were terminated yesterday and create the request needed.Question:  I don't have great scripting background and do not know how I would script this out?  Any ideas?

 

Thank You

2 REPLIES 2

Xavier Cordero
Kilo Sage

Hello aj_becker,

Path of least resistance would be to add a true/false field within the user table (in this case I'll name it "Termination Workflow Initiated"), and then add it to the business rule within the conditions. Then in the set values section of the business rule change the field value to true. That way, the business rule will only run once and you can now easily know on who it has been run.

The only reason I suggest that path is because it sounds like the business rule is already running, so it would just be easier to do this vs creating additional custom functionality on top which may also break in the future (as well as the fact that it will allow you to easily track when the request workflow has been triggered on a user moving forward).

DirkRedeker
Mega Sage
Hi Maybe you run the flow on a table trigger instead of a scheduled job. That way, you will have access to the fields. To loop, you can use a timer and check the condition after the timer (1 day) expires. If needed go back to the timer waiting another day. This way, your flow wakes up every day, like with your scheduled job, but you will have access to the fields. To fire the flow, you can use the condition, that the termination date is not empty anymore. Does that sound helpful? BR Dirk