Forum Discussion

Pieter Veenstra's avatar
Sep 15, 2016

Creating list items using Flow

I'm trying to create a flow that will start on the modification of a list item.

 

The flow needs to create a list items in anoother list.

 

I've created a Http step to create the item using the REST API. ( https://msdn.microsoft.com/en-us/library/office/dn292552.aspx)

 

 

so that should meant that I need to push the following into my step:

 

url: http://mytenant.sharepoint.com/sites/MySitecollection/_api/web/lists/GetByTitle(‘MyList')/items
method: POST
body: { '__metadata': { 'type': 'SP.Data.TestListItem' }, 'Title': 'Test'}
headers:
    Authorization: "Bearer " + accessToken
     X-RequestDigest: form digest value
    accept: "application/json;odata=verbose"
    content-type: "application/json;odata=verbose"
    content-length:length of post body

 

So in the Uri section of the task I'm getting "Enter a valid uri" when I add the above Url.

 

In the Headers section I get: "Enter a valid json"

 

in the body I'm getting : "Enter a valid json"

 

So in short I'm not having much luck.

 

Also in the header section how do I get my accessToken using Flow?

 

Has anybody got this to work?

 

Resources