Do more with Flow Send an HTTP Request to SharePoint and Site Designs

%3CLINGO-SUB%20id%3D%22lingo-sub-192161%22%20slang%3D%22en-US%22%3EDo%20more%20with%20Flow%20Send%20an%20HTTP%20Request%20to%20SharePoint%20and%20Site%20Designs%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-192161%22%20slang%3D%22en-US%22%3E%3CP%3EI've%20been%20using%20Site%20Designs%20and%20Scripts%20to%20provision%20SharePoint%20sites%20with%20pre-set%20document%20libraries%2C%20lists%20and%20themes%20but%20there%20are%20still%20lots%20of%20provisioning%20things%20that%20are%20missing%20to%20create%20a%20complete%20site%20template.%3C%2FP%3E%0A%3CP%3EThis%20is%20where%20%22Send%20an%20HTTP%20Request%20to%20SharePoint%22%20Flow%20action%20comes%20in.%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20part%20of%20the%20Site%20Script%2C%20I%20can%20call%20a%20Flow%20to%20complete%20further%20actions%20including%20calling%20out%20to%20some%20PnP%20code%20in%20Azure.%26nbsp%3B%20In%20this%20Flow%2C%20I%20can%20now%20use%20this%20new%20action%20to%20call%20any%20SharePoint%20API%20request%3B%20my%20first%20experiment%20was%20with%20creating%20a%20Folder%20in%20the%20base%20document%20library%20which%20worked%20great.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F33844i2091C26FC79D0AB2%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Send%20a%20HTTP%20Request.JPG%22%20title%3D%22Send%20a%20HTTP%20Request.JPG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3ENext%20steps%20are%20to%20see%20if%20adding%20content%20types%20and%20other%20typical%20configurations%20work.%26nbsp%3B%20And%20then%20I%20need%20to%20ask%20myself%20if%20I%20should%20do%20this%20in%20Flow%20or%20custom%20code.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-192161%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESites%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-218763%22%20slang%3D%22en-US%22%3ERe%3A%20Do%20more%20with%20Flow%20Send%20an%20HTTP%20Request%20to%20SharePoint%20and%20Site%20Designs%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-218763%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F38235i9B74EB3ED86CFB89%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22Snap1.jpg%22%20title%3D%22Snap1.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20getting%20the%20output%2C%20I've%20used%20the%20following%20with%20a%20variable%3C%2FP%3E%3CP%3Ebody('Get_Item_Content_Type')%5B'd'%5D%5B'ContentTypeId'%5D%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%22Get_Item_Content_Type%22%3C%2FP%3E%3CP%3EThis%20is%20the%20name%20of%20the%20action%20%22Send%20HTTP%20Request...%22%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-192707%22%20slang%3D%22en-US%22%3ERe%3A%20Do%20more%20with%20Flow%20Send%20an%20HTTP%20Request%20to%20SharePoint%20and%20Site%20Designs%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-192707%22%20slang%3D%22en-US%22%3EI%20added%20a%20request%20to%20retrieve%20items%20from%20a%20list.%20Then%20as%20a%20next%20step%20I%20added%20data%20operation%20%22Parse%20JSON%22%20where%20I%20provided%20a%20sample%20json%20response%20to%20create%20the%20schema%20and%20then%20I%20was%20able%20to%20add%20a%20%22Apply%20to%20each%22%20to%20do%20some%20business%20logic.%20Not%20sure%20if%20there%20was%20a%20better%20way.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-192665%22%20slang%3D%22en-US%22%3ERe%3A%20Do%20more%20with%20Flow%20Send%20an%20HTTP%20Request%20to%20SharePoint%20and%20Site%20Designs%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-192665%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20Alan%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAfter%20constructing%20such%20a%20request%20do%20you%20know%20how%20to%20get%20the%20output%20of%20the%20request%20as%20input%20to%20the%20next%20flow%20step%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-192595%22%20slang%3D%22en-US%22%3ERe%3A%20Do%20more%20with%20Flow%20Send%20an%20HTTP%20Request%20to%20SharePoint%20and%20Site%20Designs%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-192595%22%20slang%3D%22en-US%22%3E%3CP%3EGreat%20info%20thanks%20for%20sharing!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1599013%22%20slang%3D%22en-US%22%3ERe%3A%20Do%20more%20with%20Flow%20Send%20an%20HTTP%20Request%20to%20SharePoint%20and%20Site%20Designs%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1599013%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F180%22%20target%3D%22_blank%22%3E%40Alan%20Marshall%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWere%20you%20able%20to%20figure%20out%20how%20to%20add%20content%20types%20to%20a%20list%20or%20library%20with%20this%20method%3F%26nbsp%3B%20I%20am%20trying%20to%20figure%20that%20out%20now.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EVR%2C%3C%2FP%3E%3CP%3EBrian%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Regular Contributor

I've been using Site Designs and Scripts to provision SharePoint sites with pre-set document libraries, lists and themes but there are still lots of provisioning things that are missing to create a complete site template.

This is where "Send an HTTP Request to SharePoint" Flow action comes in. 

As part of the Site Script, I can call a Flow to complete further actions including calling out to some PnP code in Azure.  In this Flow, I can now use this new action to call any SharePoint API request; my first experiment was with creating a Folder in the base document library which worked great.

Send a HTTP Request.JPG

Next steps are to see if adding content types and other typical configurations work.  And then I need to ask myself if I should do this in Flow or custom code.

5 Replies

Great info thanks for sharing!

Hello Alan,

 

After constructing such a request do you know how to get the output of the request as input to the next flow step?

 

Thanks

I added a request to retrieve items from a list. Then as a next step I added data operation "Parse JSON" where I provided a sample json response to create the schema and then I was able to add a "Apply to each" to do some business logic. Not sure if there was a better way.

Snap1.jpg

 

For getting the output, I've used the following with a variable

body('Get_Item_Content_Type')['d']['ContentTypeId']

 

"Get_Item_Content_Type"

This is the name of the action "Send HTTP Request..."

Hi @Alan Marshall ,

 

Were you able to figure out how to add content types to a list or library with this method?  I am trying to figure that out now.

 

VR,

Brian