SOLVED

Creating list items using Flow

%3CLINGO-SUB%20id%3D%22lingo-sub-13003%22%20slang%3D%22en-US%22%3ECreating%20list%20items%20using%20Flow%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-13003%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20trying%20to%20create%20a%20flow%20that%20will%20start%20on%20the%20modification%20of%20a%20list%20item.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20flow%20needs%20to%20create%20a%20list%20items%20in%20anoother%20list.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20created%20a%20Http%20step%20to%20create%20the%20item%20using%20the%20REST%20API.%20(%20%3CA%20href%3D%22https%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Foffice%2Fdn292552.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Foffice%2Fdn292552.aspx%3C%2FA%3E)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eso%20that%20should%20meant%20that%20I%20need%20to%20push%20the%20following%20into%20my%20step%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3Eurl%3A%20%3CA%20href%3D%22http%3A%2F%2Fmytenant.sharepoint.com%2Fsites%2FMySitecollection%2F_api%2Fweb%2Flists%2FGetByTitle(%E2%80%98MyList')%2Fitems%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fmytenant.sharepoint.com%2Fsites%2FMySitecollection%2F_api%2Fweb%2Flists%2FGetByTitle(%E2%80%98MyList')%2Fitems%3C%2FA%3E%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3Emethod%3A%20POST%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3Ebody%3A%20%7B%20'__metadata'%3A%20%7B%20'type'%3A%20'SP.Data.TestListItem'%20%7D%2C%20'Title'%3A%20'Test'%7D%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3Eheaders%3A%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Authorization%3A%20%22Bearer%20%22%20%2B%20accessToken%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20X-RequestDigest%3A%20form%20digest%20value%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20accept%3A%20%22application%2Fjson%3Bodata%3Dverbose%22%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20content-type%3A%20%22application%2Fjson%3Bodata%3Dverbose%22%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20content-length%3Alength%20of%20post%20body%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20in%20the%20Uri%20section%20of%20the%20task%20I'm%20getting%20%22Enter%20a%20valid%20uri%22%20when%20I%20add%20the%20above%20Url.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20the%20Headers%20section%20I%20get%3A%20%22Enter%20a%20valid%20json%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ein%20the%20body%20I'm%20getting%20%3A%20%22Enter%20a%20valid%20json%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20in%20short%20I'm%20not%20having%20much%20luck.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAlso%20in%20the%20header%20section%20how%20do%20I%20get%20my%20accessToken%20using%20Flow%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHas%20anybody%20got%20this%20to%20work%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-13003%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Flow%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-13040%22%20slang%3D%22en-US%22%3ERE%3A%20Creating%20list%20items%20using%20Flow%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-13040%22%20slang%3D%22en-US%22%3EI've%20now%20found%20a%20valid%20way%20to%20remove%20the%20error%20message%3A%20%3CA%20href%3D%22https%3A%2F%2Fveenstra.me.uk%2F2016%2F09%2F15%2Foffice-365-sharepoint-online-creating-list-items-using-microsoft-flow%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fveenstra.me.uk%2F2016%2F09%2F15%2Foffice-365-sharepoint-online-creating-list-items-using-microsoft-flow%2F%3C%2FA%3E%20It%20looks%20like%20Flow%20doesn't%20re-validate%20the%20Uri%20field%20on%20the%20form.%20Once%20you've%20got%20an%20invalid%20Uri%20entered%20all%20you%20can%20do%20is%20create%20a%20new%20Http%20step%3C%2FLINGO-BODY%3E
MVP

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?

 

1 Reply
best response confirmed by Pieter Veenstra (MVP)
Solution
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-f... 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