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

Error when trying to create an item in sharepoint with multi-select choice field

I am trying to update a multi-select choice field in a sharepoint list from flow.   I keep getting the error 

OpenApiOperationParameterValidationFailed. The 'inputs.parameters' of workflow operation 'Create_item' of type 'OpenApiConnection' is not valid. Error details: The API operation does not contain a definition for parameter 'item/Color'.

If I hardcode those array values in the Create item section it creates without any problems.   It is just when I'm passing in an array to the multi-select choice field.

Below is the column definition in sharepoint and the flow they I created to update this column.

Flow_Error_Sharepoint_def.png

 

Flow_Error_Flow_def.png

 

If I harcode it like the following it works without a problem.

 

flow_error_hardcoded.png

If you look at the inputs for the Create Item step they both show the following:

 

{
  "host": {
    "apiId": "subscriptions/12345678-1234-1234-a1234-1234567890/providers/Microsoft.Web/locations/westus/runtimes/msmanaged-na/apis/sharepointonline",
    "connectionReferenceName": "shared_sharepointonline",
    "operationId": "PostItem"
  },
  "parameters": {
    "dataset": "https://sitename.sharepoint.com/sites/ABC/IT",
    "table": "1234-1234-1324-1234-123456789012",
    "item/Title": "Test2",
    "item/Color": [
      {
        "Value": "Red"
      },
      {
        "Value": "Yellow"
      }
    ]
  }
}

Anyone have any idea on this error, or another way to populate a multi-select choice field?

1 ACCEPTED SOLUTION

Accepted Solutions
Brian2M
Level: Powered On

Re: Error when trying to create an item in sharepoint with multi-select choice field

My original logic is now working.   Something must have been adjusted in the backend.   I took one of my original flows that was failing at the beginning of the week and reran without modifying it and it now works correctly.

 

Thanks @v-yamao-msft for the suggestions, but changes must be rolling out and my tenant must have been having some issues.

 

 

View solution in original post

6 REPLIES 6
Community Support Team
Community Support Team

Re: Error when trying to create an item in sharepoint with multi-select choice field

Hi @Brian2M ,

 

Please take a try with the following workaround.

 

Instead of inputting the value into a variable directly, please try with a Compose.

 

After the Compose action, initialize an Array variable.

 

Add Apply to each, select from Compose output, add Append to array variable within the loop, and input the following function in the Value field:

items('Apply_to_each')?['value']

 

Under Apply to each, add Compose 2 with the following code:

join(variables('Test'),',')

 

Add action Create item, in the Multiple selection enabled Choice column, select Compose 2 output as a custom value.

1.PNG2.PNG

 

Best regards,

Mabel          

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Brian2M
Level: Powered On

Re: Error when trying to create an item in sharepoint with multi-select choice field

@v-yamao-msft -

 

Tried your suggestion and the same error still comes up.

 

It appears in the input to the Create Item step that it is just representing the options as a standard array.  Is this how your input looks?

{
  "host": {
    "apiId": "subscriptions/12345678-1234-1234-1234-123456789012/providers/Microsoft.Web/locations/westus/runtimes/msmanaged-na/apis/sharepointonline",
    "connectionReferenceName": "shared_sharepointonline",
    "operationId": "PostItem"
  },
  "parameters": {
    "dataset": "https://MySite.sharepoint.com/sites/ABC/IT",
    "table": "123456-1234-1234-1234-123456789012",
    "item/Title": "Test2",
    "item/Color": "Red,Yellow"
  }
}

Flow_Top.png

 

Flow_bottom.png

 

 

Community Support Team
Community Support Team

Re: Error when trying to create an item in sharepoint with multi-select choice field

Hi @Brian2M ,

 

In the action Create item, for the multiple selection enabled column, instead of switching to input entire array, please stay with the detail inputs, and select the compose output as a custom value.

1.PNG

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Brian2M
Level: Powered On

Re: Error when trying to create an item in sharepoint with multi-select choice field

@v-yamao-msft 

 

That appears to work, but the values do not appear to be selected in sharepoint.

Below is a manually entered item and the TEST2 entered from the flow suggestion.  On the list they look exactly the same.


Flow_test2_list.png

 

If I look at the Manually entered item it shows Red and Yellow selected.flow_test2_manual.png

 

On the item that was entered using flow the Colors do not appear to be selected.

Flow_Test2_auto.png

flow_test2_auto2.png

 

 

Brian2M
Level: Powered On

Re: Error when trying to create an item in sharepoint with multi-select choice field

My original logic is now working.   Something must have been adjusted in the backend.   I took one of my original flows that was failing at the beginning of the week and reran without modifying it and it now works correctly.

 

Thanks @v-yamao-msft for the suggestions, but changes must be rolling out and my tenant must have been having some issues.

 

 

View solution in original post

Community Support Team
Community Support Team

Re: Error when trying to create an item in sharepoint with multi-select choice field

Hi @Brian2M ,

 

Thanks for updating and glad to hear that it is working for you now.

 

Hope my suggestions could be helpful as well.

 

Best regards,

Mabel  

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (6,154)