cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Regular Visitor

Flow that triggers Planner Task based on Hire Date

Hi all,

 

Apologies if this has been answered before, but I've been unsuccessful finding anything through searches.  Happy to be redirected.

 

I'm looking for guidance in building a flow that automates a training plan for new employee hires.  Essentially, 'John Smith' will have to complete 'Training x' 3 days after their hire date, 'Training y' 5 days after their hire date, and so on.  I'm able to create an Planner Task action with due date = addDays(utcNow(), +5, 'yyyy-MM-ddT00:00:00EST') but I need to replace the 'utcNow()' with their dynamic starting/hire date (would want to enter this only once since it will likely be 15+ trainings over the course of a year).

 

Trigger - New Employee (name & hire date)

   -not sure where/what software would be most effective place to log this info (read on another answer that MS Forms is good for this, but unfortunately my company doesn't have this enabled)

Actions - (multiple) Tasks in Planner (as above, 'Training x' based on hire date + 3 days)

 

Any help is appreciated, thank you!

1 ACCEPTED SOLUTION

Accepted Solutions

Sure!

On your new Sharepoint list, you can add a date column to store hire date, lest call it 'HireDate'.

 

In your flow, use 'When an item is created' trigger

Then Planner 'Create task'

The maths to calculate ('Training x' based on hire date + 3 days) are simple:

 

Replace

due date = addDays(utcNow(), +5, 'yyyy-MM-ddT00:00:00EST')

and use

due date = addDays(triggerBody('HireDate'),3,'yyyy-MM-ddT00:00:00EST') 

 

Not with my laptop, unable to test it yet

Hope it helps

 

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

7 REPLIES 7
Super User III
Super User III

Hi!

The first problem to solve is the trigger.

Do your company have Sharepoint? If so, I would suggest to create a new item in a Sharepoint list and trigger 'When an item is created'

If not, you can use 'Manually trigger a flow' and add the data you need as inputs from Power Automate console

Please let us know if any of these two approaches fits your requirements to continue discussing further details

Thanx!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



We do use Sharepoint so that works.

 

Could you assist with how to get the correct training date based on hire date?

Sure!

On your new Sharepoint list, you can add a date column to store hire date, lest call it 'HireDate'.

 

In your flow, use 'When an item is created' trigger

Then Planner 'Create task'

The maths to calculate ('Training x' based on hire date + 3 days) are simple:

 

Replace

due date = addDays(utcNow(), +5, 'yyyy-MM-ddT00:00:00EST')

and use

due date = addDays(triggerBody('HireDate'),3,'yyyy-MM-ddT00:00:00EST') 

 

Not with my laptop, unable to test it yet

Hope it helps

 

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

@efialttes I don't suppose there's an easy way to automate avoiding weekends/holidays for the due date, is there? (Keeping it to business days only)

 

Thanks so much for your help!

Hi again!

First of all, did my initial suggestions worked? If so, that's great news!

I think there is a reasonable way to remove weekends... but please note I am about to have dinner with my kids, give me some time for the answer!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Yes, your solution worked flawlessly!

 

No rush at all, enjoy dinner with your kids!  Thanks again for being so helpful with my questions.

Hi!

Plase have a look to this thread. I think it is very similar to what you are looking for -at least to remove weekends-

https://powerusers.microsoft.com/t5/Building-Flows/Calculating-Business-days-using-flows/td-p/315402

 

Also remember, the best way to thank for the support, is by clicking 'Thumbs up' in any partial answer you found valuable, or even in all of them  😉

Flow_thumbsUp.png

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (35,882)