Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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:
  • narayan225 Profile Picture
    2,449 Super User 2025 Season 1 on at
    Re: Creating a second task if the Planner errors because Maximum Checklist Items exceeds twenty

    @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!

  • jaredbidlow Profile Picture
    256 on at
    Re: Creating a second task if the Planner errors because Maximum Checklist Items exceeds twenty

    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,449 Super User 2025 Season 1 on at
    Re: Creating a second task if the Planner errors because Maximum Checklist Items exceeds twenty

    @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!

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard