Creating a custom list inside appweb “programmatically” for a provider hosted sharepoint add-in

%3CLINGO-SUB%20id%3D%22lingo-sub-839404%22%20slang%3D%22en-US%22%3ECreating%20a%20custom%20list%20inside%20appweb%20%E2%80%9Cprogrammatically%E2%80%9D%20for%20a%20provider%20hosted%20sharepoint%20add-in%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-839404%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20new%20to%20Sharepoint%20development%20and%20I%20am%20looking%20for%20a%20way%20to%20create%20a%20new%20list%20inside%20appweb%20space%20(this%20list%20will%20be%20specific%20to%20the%20addin)%20for%20a%20provider%20hosted%20add-in.%20I%20understand%20I%20can%20create%20a%20list%20using%20visual%20studio%20during%20addin%20development%20and%20deploy%20the%20addin.%20I%20read%20this%20reference%20from%20Microsoft%20about%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fsp-add-ins%2Fcreate-a-provider-hosted-add-in-that-includes-a-custom-sharepoint-list-and-conte%22%20rel%3D%22noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%20target%3D%22_blank%22%3Ecreating%20list%20inside%20a%20provider%20hosted%20add-in%3C%2FA%3E%3C%2FP%3E%3CP%3EBut%20I%20don't%20want%20to%20make%20changes%20to%20the%20add-in%2C%20so%20I%20am%20looking%20for%20a%20way%20to%20create%20a%20similar%20list%20using%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fsp-add-ins%2Fworking-with-lists-and-list-items-with-rest%22%20rel%3D%22noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%20target%3D%22_blank%22%3Esharepoint%20API%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Edirectly.%20Is%20there%20any%20specific%20reason%20not%20to%20use%20the%20Sharepoint%20API%20and%20use%20the%20add-in%20to%20create%20such%20a%20list%20%3F%20I%20am%20not%20sure%20if%20this%20is%20even%20possible%20for%20a%20provider%20hosted%20add-in%20(creating%20a%20list%20inside%20app%20web%20instead%20of%20the%20usual%20sharepoint%20space).%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-839806%22%20slang%3D%22en-US%22%3ERe%3A%20Creating%20a%20custom%20list%20inside%20appweb%20%E2%80%9Cprogrammatically%E2%80%9D%20for%20a%20provider%20hosted%20sharepoint%20add-in%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-839806%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F404073%22%20target%3D%22_blank%22%3E%40Abi175%3C%2FA%3E%26nbsp%3BIf%20I%20understand%20correctly%20you%20want%20to%20create%20list%20in%20SharePoint%20as%20one%20time%20activity.%20Then%20why%20don't%20you%20write%20a%20small%20console%20using%20csom%2Fjsom%20code%20to%20create%20a%20list%20and%20define%20the%20as%20per%20your%20needs.%3C%2FP%3E%3CP%3ECSOM%20Crud%20Operation%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fprevious-versions%2Foffice%2Fdeveloper%2Fsharepoint-2010%2Fhh185005(v%253Doffice.14)%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fprevious-versions%2Foffice%2Fdeveloper%2Fsharepoint-2010%2Fhh185005(v%253Doffice.14)%3C%2FA%3E%3C%2FP%3E%3CP%3EJSOM%20Crud%20Operation%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fprevious-versions%2Foffice%2Fdeveloper%2Fsharepoint-2010%2Fhh185005(v%253Doffice.14)%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fprevious-versions%2Foffice%2Fdeveloper%2Fsharepoint-2010%2Fhh185005(v%253Doffice.14)%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-841547%22%20slang%3D%22en-US%22%3ERe%3A%20Creating%20a%20custom%20list%20inside%20appweb%20%E2%80%9Cprogrammatically%E2%80%9D%20for%20a%20provider%20hosted%20sharepoint%20add-in%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-841547%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F394813%22%20target%3D%22_blank%22%3E%40Vikram_Samal%3C%2FA%3E%26nbsp%3BThank%20you%20for%20your%20reply.%20I%20was%20looking%20to%20use%20the%20API%20directly%20instead%20of%20using%20CSOM%20or%20visual%20studio%20addin%20template.%20I%20figured%20that%20I%20can%20create%20a%20list%20using%20the%20Create%20list%20REST%20API%20after%20getting%20the%20correct%20App%20Web%20Url%20(which%20I%20was%20missing%20earlier).%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

I am new to Sharepoint development and I am looking for a way to create a new list inside appweb space (this list will be specific to the addin) for a provider hosted add-in. I understand I can create a list using visual studio during addin development and deploy the addin. I read this reference from Microsoft about creating list inside a provider hosted add-in

But I don't want to make changes to the add-in, so I am looking for a way to create a similar list using the sharepoint API directly. Is there any specific reason not to use the Sharepoint API and use the add-in to create such a list ? I am not sure if this is even possible for a provider hosted add-in (creating a list inside app web instead of the usual sharepoint space).

2 Replies
Highlighted

@Abi175 If I understand correctly you want to create list in SharePoint as one time activity. Then why don't you write a small console using csom/jsom code to create a list and define the as per your needs.

CSOM Crud Operation

https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/hh185005(v%3Doff...

JSOM Crud Operation

https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/hh185005(v%3Doff...

Highlighted

@Vikram_Samal Thank you for your reply. I was looking to use the API directly instead of using CSOM or visual studio addin template. I figured that I can create a list using the Create list REST API after getting the correct App Web Url (which I was missing earlier).