0

I am creating a flow right now that will create pages every week. The thing is, im using the "Send an HTTP request to sharepoint" to create the pages. Below you can see that part: enter image description here

The problem is, whenever I start the flow, it shows me the following error:

{
  "status": 400,
  "message": "Invalid JSON. A comma character ',' was expected in scope 'Object'. Every two elements in an array and properties of an object must be separated by commas.\r\nclientRequestId: 8fc18d2f-80e8-4705-98fe-98fb9c1e7b98\r\nserviceRequestId: 0283ad9e-9062-0000-37db-27d19952771c",
  "source": "https://XXXXXXX.sharepoint.com/sites/(SiteName)/(SubSite Name)/_api/web/lists/getbytitle('Pages')/items",
  "errors": [
    "-1",
    "Microsoft.SharePoint.Client.InvalidClientQueryException"
  ]
}

When i add that come to the object it says, the comma can't be there. So i assume the problem isn't about the comma, but rather about the coding itself, but i can't figure it out... Can someone help me?

EDIT: I am also using taxonomy fields, maybe that's why there is this error?

0

Might not be an answer, but I'm adding my 2 cents.

The JSON seems to be valid from the first glance. Although:

  • You can remove all headers. These should be inserted automatically by the SharePoint's HTTP action.
  • x-ReuqestDigest is not going to work: $("#_REQUESTDIGEST").val() is a jQuery function that tries to find a hidden input with an ID _REQUESTDIGEST from a web page. You don't have a) jQuery or a b) webpage. Nor can you run any JavaScript from an MS Flow.

How about creating a page using create SharePoint list item action instead of HTTP? Does it not work for you because you need to specify a content type?

  • I can't create a page using 'Create a List item' because my fields are Publishing HTML. Flow doesn't recognize Publishing HTML fields, when using 'create an item' actions, therefore im basically forced to use this... – João Dec 20 '18 at 8:13
  • When i remove the "RequestDigest", it still shows me the error. – João Dec 20 '18 at 8:36
0

In body use single quote(') instead of double quote (") and it will work.

  • It did not work... – João Feb 5 at 14:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.