cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bodgerrolls
New Member

Flow Create All-day Event from Due Date

Hi,

 

I'm trying to create flow that adds an all-day event into my calendar when a google task is created. I'm editing a library flow which currently creates a 30 min event at midnight.

 

My problem is that the dynamic content from the trigger is limited to due date and in order to make the event an all day one I believe I need to set the end time to 24H after the start time.

 

I am attempting to do this with addHours: 

 

Screenshot from 2019-01-07 19-58-04.png

 

But it's not working out. 

 

Apologies - I'm a little our of my depth but have spent some hours trying to work it out. If someone could show me how to construct the expression and strings correctly I'd be grateful. Many thanks!

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bacao-msft
Community Support
Community Support

Hi @bodgerrolls,

 

Could you provide a clear screenshot of the Flow configuration?

I am not sure what the trigger you are using.

If the trigger you configured is "When a task is added to a task list", you could use the following method to create "all day event".

  1. Configure Get a task from a task list action to get the Due date of the task.
  2. When configuring Task ID, first select "Enter custom value", then fill in "Items Task Id" output from the trigger.
  3. Then configure the Due output of this action in End time, use addDays () function to get the start time of the day and populate it in Start Time field.
  4. Finally, you need to set "Is all day event?" option to Yes.

Start time-Expression:

addDays(body('Get_a_task_from_a_task_list')?['due'],-1)

Image reference:

1.PNG

Please take a try again.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-bacao-msft
Community Support
Community Support

Hi @bodgerrolls,

 

Could you provide a clear screenshot of the Flow configuration?

I am not sure what the trigger you are using.

If the trigger you configured is "When a task is added to a task list", you could use the following method to create "all day event".

  1. Configure Get a task from a task list action to get the Due date of the task.
  2. When configuring Task ID, first select "Enter custom value", then fill in "Items Task Id" output from the trigger.
  3. Then configure the Due output of this action in End time, use addDays () function to get the start time of the day and populate it in Start Time field.
  4. Finally, you need to set "Is all day event?" option to Yes.

Start time-Expression:

addDays(body('Get_a_task_from_a_task_list')?['due'],-1)

Image reference:

1.PNG

Please take a try again.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
bodgerrolls
New Member

Thank you so much for your reply! And sorry for the slow response.

 

I've tried your solution, which makes sense, but I'm still haveing no success with the date string. Here's a screenshot with both the flow and the test output.

 

The full output reads:

 

{
"status": 400,
"message": "The string was not recognized as a valid DateTime. There is an unknown word starting at index 0.\r\nclientRequestId: fbb42bad-3002-4abc-ae47-f6509862a30c",
"source": "office365-ne.azconn-ne.p.azurewebsites.net"
}

 

Have I misapplied the solution?

 

Regards,

 

Rog

 

Screenshot from 2019-01-19 13-52-50.png

Hi @bodgerrolls,

 

Thank you for your reply.

Maybe my description is confusing to you.

I provide your formula to be filled in Expression before it can be applied to the corresponding field.

Like:

26.PNG

Also for the use of Expression, please refer to the Online doc:

https://docs.microsoft.com/en-us/flow/use-expressions-in-conditions

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
bodgerrolls
New Member

Thank you - that sorted it, I've learnt something.

 

Unfortunately Flow doesn't seem to be able to handle what I need to do at the moment, while this Flow works when I add a task with a due date prior to the Flow running, when I add a task, then add a due date it reports an error because it expects a due date. I'm sure it would be possible to tweek it so that error wasn't reported, but it still wouldn't change the Outlook event's date when the due date is changed in Google tasks. I realise what I'm after is fully reliable Sync and that doesn't seem available at the moment.

 

I would however commend to MS that a full Google Tasks - Office 365 Tasks sync is made available.

 

Many thanks for your help though!

 

Best,

 

Roger

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,259)