cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Salamander94
Level: Powered On

How to create a task with a date picker?

So I've got a date picker for a "follow up date" feild.  I am trying to create a task reminder that is set to remind them on the date they choose.  I can't really figure out the outlook tasks connector.  Here's the code I have set to the "on select" property of the date picker.

Set(followdate, DatePicker1_1) & OutlookTasks.CreateTask(ThisItem.Customer & ThisItem.Date,{ReminderDateTime: 'Follow Up Date'}, {Body: ThisItem.Customer & ThisItem.Date})
8 REPLIES 8
Super User
Super User

Re: How to create a task with a date picker?

Hi @Salamander94 

 

Can you please try to modify your expression as:
 
Set(followdate, DatePicker1_1.SelectedDate);OutlookTasks.CreateTask({ReminderDateTime: followdate,Body:{},StartDateTime: ThisItem.Date})
This is just a similar format you can use, please modify the parameters inside it. Please make sure that the OutlookTasks.CreateTask has only one arguement passed. For more information regarding the create Task parameters, please refer:
 
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Community Support Team
Community Support Team

Re: How to create a task with a date picker?

Hi @Salamander94 ,

Do you want to create a Task within your Outlook task list based on the selected date within the DatePicker control?

 

Based on the formula that you mentioned, I think there is something wrong with your formula. The ReminderDateTime field within the OutlookTasks.CreateTask() function is required to proivde a Record value rather than a Date time value. The Body field is also need to provide a Record value rather than a text value.

 

I have made a test on my side, please take a try with the following workaround:10.JPG

Set the OnSelect property of the "Create Task" button to following:

OutlookTasks.CreateTask(
"AI Builder Model Test",
{
ReminderDateTime: {DateTime: DatePicker1.SelectedDate, TimeZone: "Asia/Shanghai"},
Body: {Content:"AI Builder Model Test",ContentType:"text"}
}
)

On your side, you should add a button control along side the DatePicker control, and set the OnSelect property to following:

OutlookTasks.CreateTask(
ThisItem.Customer & ThisItem.Date,
{
ReminderDateTime: {DateTime: DatePicker1_1.SelectedDate, TimeZone: "Asia/Shanghai"},
Body: {Content: ThisItem.Customer & ThisItem.Date, ContentType:"text"}
}
)

Within above TimeZone field, you need to specify your own time zone there. E.G. you are in America/New_York, so you need to set the TimeZone property to America/New_York. The available time zones values, please check the following article:

https://docs.microsoft.com/en-us/graph/api/resources/datetimetimezone?view=graph-rest-1.0

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Salamander94
Level: Powered On

Re: How to create a task with a date picker?

powerapps.PNG

So I get this error and I'm not sure what to do.

Super User
Super User

Re: How to create a task with a date picker?

Hi @Salamander94 

The error might be because CreateTask expects two arguments and here you have provided three. Also, can you please highlight where exactly in the formula are you getting this error?
Salamander94
Level: Powered On

Re: How to create a task with a date picker?

powerappshelp.PNGI hope this helps

Community Support Team
Community Support Team

Re: How to create a task with a date picker?

Hi @Salamander94 ,

Based on the screenshot that you mentioned, I think there is something wrong with your formula. Have you taken a try with the formula I provided above?

 

On your side, you should type the following formula within the OnSelect property of the "Button" control:

OutlookTasks.CreateTask(
ThisItem.Customer & ThisItem.Date,
{
ReminderDateTime: { DateTime: DatePicker1_1.SelectedDate, TimeZone: "America/New_York" },
Body: { Content: "Type your Task content here", ContentType:"text" }
}
)

Note: The ReminderDateTime property and Body property is required to provide a Record value not a Text value, please do not miss the '{ }' within your formula. You could copy above formula directly into the OnSelect property of the "Button" control in your app.

 

Please take a try with above formula carefully within your app, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Salamander94
Level: Powered On

Re: How to create a task with a date picker?

Okay so I've gotten it to the point where it doesn't give me an error thanks to all of everyone's help and code!  However, I can't seem to find any tasks being created.  appscodefortask.PNG

Salamander94
Level: Powered On

Re: How to create a task with a date picker?

Okay so I've located them I apologize for the confusion.  However, how do I get spaces added inbetween the information the task is created with?space.PNGLike a space inbetween the "Kevster" and "Date".  I tried adding "" with an "&" as well as a ";" but neither of them actually entered a space for me in the output stage.  Also, how would I make the app remind him at 8:00 am everytime or 9:00 am? 

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

Follow PowerApps on Twitter

Stay Up-to-Date by following PowerApps on Twitter

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 4 members 4,189 guests
Please welcome our newest community members: