web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Creating a second task...
Power Apps
Unanswered

Creating a second task if the Planner errors because Maximum Checklist Items exceeds twenty

(0) ShareShare
ReportReport
Posted on by 256

It is my intention to create a second task with the "error" items.

 

here is the update function:

 

 

With(
 {
 desc: Split(
 DescriptionTextInput.Value,
 Char(10)
 ),
 bool: StartsWith(
 DescriptionTextInput.Value,
 "Record"
 )
 },
 ForAll(
 Sequence(
 CountRows(desc) - bool,
 If(
 bool,
 2,
 1
 )
 ),
 Planner.UpdateTaskDetailsV2(
 NewTask.id,
 {
 description: CommentsTextInput.Value,
 checklist: {
 id: ThisRecord.Value,
 isChecked: false,
 title: Index(
 desc,
 ThisRecord.Value
 ).Value
 }
 }
 )
 )
 ),

 

 

If Planner.CreateTaskV4 errors out due to "MaximumChecklistItemsOnTask", how would I catch this and create the new task (and update the 'errortask')

 

Categories:
I have the same question (0)
  • narayan225 Profile Picture
    2,547 Super User 2025 Season 2 on at

    @jaeiow 

     

    In you collection of items, add row numbers for each item.

    Add a condition for creating tasks, you can add an if statement to check if CountRows in you collection is more than 20.

    With the if condition, send the planner tasks in batches of 20 so that it doesn't exceed the limit.

     

    You can reference the limits from here: https://learn.microsoft.com/en-us/office365/planner/planner-limits

     

    Cheers!

  • jaredbidlow Profile Picture
    256 on at

    I used your input and prompted for code. Seems implementable. I will try the IF statement with <20 or 20-40 as the options. If there were more than 40 I would need a more complex formula. But, here I have something that might be viable. 

    // Split the checklist items
    ClearCollect(ColChecklistItems, Split(DescriptionTextInput.Value, Char(10)));

    // Create the first task and add up to 20 checklist items to it
    Set(NewTask, Planner.CreateTaskV4({...}));
    ForAll(
    FirstN(ColChecklistItems, 20),
    Planner.UpdateTaskDetailsV2(
    NewTask.id,
    {
    description: CommentsTextInput,
    checklist: {
    id: Value,
    isChecked: false,
    title: Index,
    desc: Value
    }
    }
    )
    );

    // If there are more than 20 items, create a second task and add the remaining items to it
    If(
    CountRows(ColChecklistItems) > 20,
    (
    Set(
    SecondTask,
    Planner.CreateTaskV4(
    {
    title: NewTask.title & " 2",
    planId: NewTask.planId,
    bucketId: NewTask.bucketId,
    // ... any other properties you need to set
    }
    )
    );
    ForAll(
    LastN(ColChecklistItems, CountRows(ColChecklistItems) - 20),
    Planner.UpdateTaskDetailsV2(
    SecondTask.id,
    {
    description: CommentsTextInput,
    checklist: {
    id: Value,
    isChecked: false,
    title: Index,
    desc: Value
    }
    }
    )
    )
    )
    );

     

     

  • narayan225 Profile Picture
    2,547 Super User 2025 Season 2 on at

    @jaeiow 

    You can loop the else statement and drop the first 20 columns and continue the process.

     

    Remove(ColChecklistItems, FirstN(ColChecklistItems,20))

     

    If the collection has more than 20 items, you can push first 20 items, then remove those items, and push 20 again.

    Cheers!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard