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

The method ListBuckets has an invalid value for parameter id

I have a connection to Microsoft Planner to view and create tasks in various Plans and Buckets.
When developing my app within the web app developer, everything works fine, however once published I receive errors as per the attachment.

The cals tp Planner for ListPlans and ListBuckets work just fine and I can create tasks without any problems. It just appears that the PowerApps app has some trouble inherently?

Anyone know if there is a means by which to catch such an error and prevent it from displaying, while Microsoft hopefully looks into the root cause of the issue?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
wi11iamr
Level: Powered On

Re: The method ListBuckets has an invalid value for parameter id

In short, it seems that the timing/sequencing of the app's logic when loading initial screens means that the ListBuckets method runs before, or simultaneously to the ListMyPlans method and as such the ListBuckets method does not receive a valid PlanID. If this is the case, then it is understandable that ListBuckets returns the error that it does.

 

With thanks to @Pstork1 for his effort and support, I've implemented the below to overcome this error.

 

1. In App OnStart property, create 2 collections for Plans and Tasks

ClearCollect(
    myPlans,
    Planner.ListMyPlansV2().value
);
ClearCollect(
    myTasks,
    Planner.ListMyTasksV2().value
)

2. In the Screen's OnVisible property, create a Collection, using an ISEMPTY test 

If(
    IsEmpty(myPlans),
    ClearCollect(
        BrowseBucketDropdown,
        {
            id: "1",
            planid: "1",
            name: "Please select a Plan"
        }
    ),
    ClearCollect(
        BrowseBucketDropdown,
        Sort(
            (Planner.ListBucketsV2(Plan_Browse.SelectedText.id).value),
            name,
            Ascending
        )
    )
)

3. Set the Items property of the Plan_Browse dropdown to the myPlans collection

4. On the Plan_Browse dropdown's OnChange property, set it to the same code as per point 2 above.

5. Set the Items property of the Bucket_Browse dropdown to the BrowseBucketDropdown collection

 

7 REPLIES 7
v-yutliu-msft
Level 10

Re: The method ListBuckets has an invalid value for parameter id

Hi @wi11iamr ,

Do you want to create a task in PowerApps?

I’ve made a similar test but not met the problem as your describition.

Could you show me the formula about creating the tack?

Since the Plan ID is an unique identifier, please check whether you’ve used the right value of it.

You could get its value by using ListMyPlans () or the compent of the site:test56_LI.jpg

 

Best regards,

Community Support Team _ Phoebe Liu

wi11iamr
Level: Powered On

Re: The method ListBuckets has an invalid value for parameter id

Hi @v-yutliu-msft , yes, I am creating tasks from within PowerApps. As per the screenshot, I select the Plan with the following code in the Items attribute of "Plan" dropdown.

Planner.ListMyPlansV2().value

I then have a "Bucket" dropdown with the following Items:

Planner.ListBuckets(Plan.Selected.id).value

This code works fine within the web development environment of PowerAPPS - I.e. No errors.

 

After selecting a Plan and a Bucket, the user enters text in a TaskDescription field and I then create the task as below. Once the task is created, I change the Visible Status of a MessageBox which informs the user that the task was created successfully.

If (
    !IsBlank(TaskDescription.Text) && TaskDescription.Text <> "Task Description" && TaskDescription.Text <> "Text input",
    ClearCollect(
        createdTasks,
        Planner.CreateTaskV2(
            Plan.Selected.id,
            TaskDescription.Text & If (
                varSelectedPartnershipName <> "-",
                "(" & varSelectedPartnershipName & ": " & varSelectedStoreName & ")"
            ),
            {
                bucketId: Bucket.Selected.id,
                startDateTime: StartByDate.SelectedDate,
                dueDateTime: DateAdd(
                    StartByDate.SelectedDate,
                    TaskPlannedDuration.Value,
                    Days
                ),
                assignments: Office365Users.MyProfile().Id
            }
        )
    );
    If (
        Len(First(createdTasks).title) > 0,
        UpdateContext({vDisplayMode: DisplayMode.Disabled});
        UpdateContext({popTaskCreated: true});
        Reset(TaskDescription),
        UpdateContext({popTaskNotCreated: true});
        UpdateContext({vDisplayMode: DisplayMode.Disabled})
    ),
    Notify(
        "Please provide a Task Description",
        NotificationType.Error
    )
);
v-yutliu-msft
Level 10

Re: The method ListBuckets has an invalid value for parameter id

Hi @wi11iamr ,

I've made a similar test but not met the problem as your description.

Do you still have the problem currently?

There were some server problems on May 2nd:

We have mitigated an issue occurring at approximately 2019-05-02 13:00-0700. Apps and services are returning to a healthy state. We are continuing to monitor the situation. [2019-05-02 16:42-0700]

 

Best regards,

Community Support Team _ Phoebe Liu

wi11iamr
Level: Powered On

Re: The method ListBuckets has an invalid value for parameter id

Thanks Phoebe, I’ve tested again and I am still getting the same error. I might try create a brand new test app in the morning to see if this works any better.
Would you have any other suggestions?
wi11iamr
Level: Powered On

Re: The method ListBuckets has an invalid value for parameter id

Hi @v-yutliu-msft, so I created a new app from scratch, using only the ListMyPlansV2, ListBucketsV2 and ListMyTasksV2 Planner methods. The app simply displays all the Planner Tasks - it does not update or create anything.

 

Even with this new "blank" app, I still get the same error displaying when I open the app:

Planner.ListBucketsV2 failed: The method 'ListBucketsV2' has an invalid value for parameter 'id'

 

I've exported my new test app and wonder if you could import it on your side to see if you get the same error as well?

(For reference, I also tried changing all the methodsto the "non V2" versions, I.e. ListMyPlans, ListBuckets and ListMyTasks, however I still get the "has an invalid value for paramater 'id' error message)

wi11iamr
Level: Powered On

Re: The method ListBuckets has an invalid value for parameter id

Hi @v-yutliu-msft , are you able to assist by downloading the test app I attached (previous comment) and seeing if you get the same error regarding the ListBuckets method?

Highlighted
wi11iamr
Level: Powered On

Re: The method ListBuckets has an invalid value for parameter id

In short, it seems that the timing/sequencing of the app's logic when loading initial screens means that the ListBuckets method runs before, or simultaneously to the ListMyPlans method and as such the ListBuckets method does not receive a valid PlanID. If this is the case, then it is understandable that ListBuckets returns the error that it does.

 

With thanks to @Pstork1 for his effort and support, I've implemented the below to overcome this error.

 

1. In App OnStart property, create 2 collections for Plans and Tasks

ClearCollect(
    myPlans,
    Planner.ListMyPlansV2().value
);
ClearCollect(
    myTasks,
    Planner.ListMyTasksV2().value
)

2. In the Screen's OnVisible property, create a Collection, using an ISEMPTY test 

If(
    IsEmpty(myPlans),
    ClearCollect(
        BrowseBucketDropdown,
        {
            id: "1",
            planid: "1",
            name: "Please select a Plan"
        }
    ),
    ClearCollect(
        BrowseBucketDropdown,
        Sort(
            (Planner.ListBucketsV2(Plan_Browse.SelectedText.id).value),
            name,
            Ascending
        )
    )
)

3. Set the Items property of the Plan_Browse dropdown to the myPlans collection

4. On the Plan_Browse dropdown's OnChange property, set it to the same code as per point 2 above.

5. Set the Items property of the Bucket_Browse dropdown to the BrowseBucketDropdown collection