cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rogermiddleton
Helper II
Helper II

Create task in folder

Hi everyone,

 

I am trying to create a task folder with Outlook Tasks and populate that same folder with the click of one button.

 

So far I am not getting it working with 2 buttons:

button 1:

UpdateContext({newTask: 'Outlook-taken'.CreateTaskFolder("Onboarding")})

button 2:

'Outlook-taken'.CreateTaskInFolderV3(newTask.Id;"Task1")

 This is  not working. Any help would be much appreciated.

 

Kind regards,

 

Roger Middleton

1 ACCEPTED SOLUTION

Accepted Solutions
poweractivate
Super User II
Super User II

@Rogermiddleton 

 

Try like this for button OnChange:

 

UpdateContext({newTask: "Outlook-taken"});UpdateContext({newTaskFolderName: "Outlook-taken-taskfolder"});UpdateContext({newTaskFolder: OutlookTasks.CreateTaskFolder(newTaskFolderName)});OutlookTasks.CreateTaskInFolderV3(newTaskFolder.Id,newTask);

 

 

Here are results of testing the above - a folder and a task item in that folder created in one click, as per your original post requirements

 

task101.gif

 

outlook-taken-23784.png

 

 

 

By the way strings do not have operable methods in Power Apps in the form of "SomeString".SomeMethod - Power Apps is not utilized in this way, the goal implied by this syntax from languages like JavaScript can be accomplished in Power Apps, but it is not in this specific syntax, as Power Apps is a low-code platform and does not use exactly same syntax as a traditional programming language, because it is a citizen developer platform, not a traditional programming environment - check if this helps as well.

View solution in original post

2 REPLIES 2
poweractivate
Super User II
Super User II

@Rogermiddleton 

 

Try like this for button OnChange:

 

UpdateContext({newTask: "Outlook-taken"});UpdateContext({newTaskFolderName: "Outlook-taken-taskfolder"});UpdateContext({newTaskFolder: OutlookTasks.CreateTaskFolder(newTaskFolderName)});OutlookTasks.CreateTaskInFolderV3(newTaskFolder.Id,newTask);

 

 

Here are results of testing the above - a folder and a task item in that folder created in one click, as per your original post requirements

 

task101.gif

 

outlook-taken-23784.png

 

 

 

By the way strings do not have operable methods in Power Apps in the form of "SomeString".SomeMethod - Power Apps is not utilized in this way, the goal implied by this syntax from languages like JavaScript can be accomplished in Power Apps, but it is not in this specific syntax, as Power Apps is a low-code platform and does not use exactly same syntax as a traditional programming language, because it is a citizen developer platform, not a traditional programming environment - check if this helps as well.

View solution in original post

Thank you for your reply! This solution helps me get back on track!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (58,470)