Skip to main content
Community site session details

Community site session details

Session Id : loK8S+zgr2cuCSSkfU83qQ
Power Apps - Building Power Apps
Unanswered

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

Like (0) ShareShare
ReportReport
Posted on 19 Jul 2023 21:46:59 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,513 Super User 2025 Season 2 on 20 Jul 2023 at 07:30:49
    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 20 Jul 2023 at 01:57:15
    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,513 Super User 2025 Season 2 on 20 Jul 2023 at 00:40:31
    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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading complete