I'm trying to create a field in a document library using a SharePoint 2013 workflow and HTTP call.
Based on what I found here: https://gist.github.com/MartinBodocky/8056791, I'm trying to reproduce the call on a SharePoint Workflow.
I've created a Workflow variable with this dictionary: (name) / (type) / (value)
__metadata / type Dictionary / Variable: metadata
Title / type String / Activity
FieldTypeKing / type Integer / 6
Required / type Boolean / False
Choices / type Dictionary / Variable: dictionaryActivities
In detail, the metadata
variable:
- type / type String / SP.FieldChoice
Then I've created the dictionaryActivities
variable like this:
- results / type String / 'Activity 1', 'Activity 2', 'Activity 3'
Then I created the HTTP call (POST) to this URL:
https://contoso.sharepoint.com/revisioni/_api/Web/Lists/GetByTitle('[%Current Item:Sport Name%]')/fields
The call failed trying the Workflow. I think the problem is in the dictionaryActivities
variable and its type.
This is what web service returned as ResponseCode:
BadRequest
Any suggestion? What is the correct variable type to use in this case?