Forum Discussion
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?
- I've now found a valid way to remove the error message: https://veenstra.me.uk/2016/09/15/office-365-sharepoint-online-creating-list-items-using-microsoft-flow/ It looks like Flow doesn't re-validate the Uri field on the form. Once you've got an invalid Uri entered all you can do is create a new Http step
- I've now found a valid way to remove the error message: https://veenstra.me.uk/2016/09/15/office-365-sharepoint-online-creating-list-items-using-microsoft-flow/ It looks like Flow doesn't re-validate the Uri field on the form. Once you've got an invalid Uri entered all you can do is create a new Http step