Hi there,
i would like to ask your help related with a current issue that i am facing. So i am creating a Sharepoint Hosted Add-in, and in there i am trying to create a new content type with two new columns. So, i started to create the project via Visual Studio, based on the Office Developer tools project template for Sharepoint Hosted Add-ins. The project comes with a feature, and any artifact i add to the project, it goes to the feature. But when i run the application, the new content type neither the new site columns are created. I was trying to figure out the location of the feature, in order to check if the feature was successfully activated. I checked the developer site ( where is running the app ) and there is no feature there. Even i checked the app catalog, and it is not there as well.
So could you explain me where is located the feature and how can i have access to it? Or, how can i troubleshoot this problem in order to check what is going on ?
Thank you.
These list changes are in the host web or the app web?
Yup . This would work. Although I’d probably just use PowerShell and the Same code. The only time I would put it into the Add-in is if the list needs to be created in every Host Web Site that I add the Add-in To.
Yes, but the drawback is that any user that wants to use the app, would require to execute the powershell in order to configure properly the host web. that’s why i am trying to find a way where the user only need to add the app to the specific site, and then use it, and the app would configure everything.
Ah then yes. You can put it into the app, and use CSOM to create the assets in the host web.
I do not believe you will see this feature in your host web. The content types you created exist in AppX site, not your /development site. They are all contained within the application itself.
Ok, so in that case what’s the AppX site? Additionally, if i have a Team Site, e.g., Team1, and if i add to this site my app ( via Add App option ), then would i have the content type and the site columns available in that site? Thank you. Ok, so in that case what’s the AppX site? Additionally, if i have a Team Site, e.g., Team1, and if i add to this site my app ( via Add App option ), then would i have the content type and the site columns available in that site? Thank you. Ok, so i forgot the detail that the host web and app web urls are reflected in the URL to access the app itself. I got the SPAppWebUrl from the query string, and basically as i told you above, the app site in this case is: https://yoursite-69953d60bfd33b.sharepoint.com/sites/development/AppX and in this case when i access the app, it goes to the default page in the following address: https://yoursite-69953d60bfd33b.sharepoint.com/sites/development/AppX/Pages/default.aspx If i try to acess the Site Contents page in the app web, so: https://yoursite-69953d60bfd33b.sharepoint.com/sites/development/AppX/_layouts/15/viewlsts.aspx i get the following error: “The endpoint /sites/development/relevantpages2/_layouts/15/viewlsts.aspx is not accessible in the context of a SharePoint App.” So, that means i cannot access it at all? Thank you.
Don’t think of Add-In’s as a deployment mechanism.They aren’t WSP’s of old… they are self-contained sites in and of themselves. So if you create a column in the Add-In, it’s only available in that add-in. If you create a list in the add-in, it will only exist in that add-in, it doesn’t exist on the site you are “adding the app”. The AppX site is used for creating little applications or webparts. You could create a Content Type/List/Columns. Plus you could add a webpart inside the add-in which uses those lists and content types. You could then use that WebPart on the host-site (Team1), but the List/Content Types/Columns do not exist on Team1, they only exist within AppX.
I understand what you mean. To be honest, my experience with add-ins was only using Provider-Hosted add-ins, with full trust, so i used to have full control over the tenant with the apps. Anyway, in that case i need the app to show content located in the host web, but the list / document library that contains that content needs to be changed in order to have the two additional columns… so i was trying to do that change in the list / document library via the deployment process of the app. Anyway, considering the scenario of Sharepoint Online, what would you recommend in that case to implement the list / DL changes? Powershell script? Thanks
Sounds like the Content Types are built in the “app web”. This is the site where the application runs. When you create a list or a content type or columns in the app, it doesn’t deploy to the host web.
If you environment is https://yoursite.sharepoint.com and you add the app here.
If you your app was named “App1”, it’s location is https://yoursite.sharepoint.com/App1. The feature and the content types are in the App1 site (called the App Web).
So, considering the following names: App Name: AppX developer site: https://yoursite.sharepoint.com/sites/development When i run the app via Visual Studio, it will open the app in the following address: https://yoursite-69953d60bfd33b.sharepoint.com/sites/development/AppX The string “69953d60bfd33b” i presume it is the App GUID. So, the app is running in the developer site and it is the app web, right? So, i checked the features in the developer site and it is not visible my custom feature, neither my custom artifacts. Am i correct in the above logic? Thank you.
Host web… Anyway, i change my way of search that need, and i found an interesting article: http://www.sharepointnutsandbolts.com/2013/06/sp2013-host-web-apps-provisioning.html Apparently, using an approach of CSOM + JSOM you can achieve that. Have a look and share your thoughts please.