Using share point hosted app

Hi All,
I have a requirement like i need to create a share point hosted app that creates a list  with items and that data should be displayed in a grid in office 365 developer site in one of the page.Please send the javascript code for this.thanksin advance.
Regards,
Praveen

Hi All,
I have a requirement like i need to create a share point hosted app that creates a list  with items and that data should be displayed in a grid in office 365 developer site in one of the page.Please send the javascript code for this.thanksin advance.
Regards,
Praveen
I would suggest you download the "Apps for SharePoint Sample pack". 
http://code.msdn.microsoft.com/sharepoint/Apps-for-SharePoint-sample-64c80184
There are several examples of SharePoint hosted-apps that you can learn from.
Tom Brownell, MCTS, MCPD SharePoint 2010

Similar Messages

  • List value retaining in Share point hosted app 2013

    I'm creating a Share point hosted app.
    I have a list inside Share point 2013 app. We are inserting records into the list through some other forms in app.
    But when we deploy the app, it is getting retracted & deployed again. So the list values are getting deleted.
    Is there any way to retain the Share point app list values during deployment?
    I tried the following things as suggested by some experts in internet.
    • Setting up the app catalog for app in Central admin and increment the version for every deployment.
    • I set the “deployment conflict resolution” property of list instance to “none”.
    But both the things not working.
    Please help me on this issue.

    Hi,
    According to your post, my understanding is that you wanted to keep the list data while redeploy the app project.
    As you had known, to keep the data in the app, we should first set up the  app catalog.
    Then we should upload your app with version 1.0.0.0. Install app to the desired web.
    After some code modification increment your version to 1.0.0.1 and upload again your app to catalog.
    Upgrade your installed app. More details about updating            
    http://sharepoint.stackexchange.com/questions/83021/app-deployment-keep-the-existing-data-in-internal-list-of-an-sharepoint-app
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Unexpected behaviour in case of single value selection by using share point excel service

    If multiple values are passed to pivot table filter using share point excel service, filter is showing “multiple” text on filter. If user expands the filter, the passed values are showing as checked ones.
    Example: ‘India’ and ‘US’ values are passed ‘Country’ filter of pivot table using excel services. Filter is showing ‘multiple’ text on filter and if user expands the filter, ‘India’ and ‘US’ values are showing as checked ones.
    If single value (India) is passed to pivot table filter using share point excel service, filter is showing value text (India) on filter. If user expands the filter, all values are showing as checked ones.
    Ideally it should show ‘India’ as checked one.

    If multiple values are passed to pivot table filter using share point excel service, filter is showing “multiple” text on filter. If user expands the filter, the passed values are showing as checked ones.
    Example: ‘India’ and ‘US’ values are passed ‘Country’ filter of pivot table using excel services. Filter is showing ‘multiple’ text on filter and if user expands the filter, ‘India’ and ‘US’ values are showing as checked ones.
    If single value (India) is passed to pivot table filter using share point excel service, filter is showing value text (India) on filter. If user expands the filter, all values are showing as checked ones.
    Ideally it should show ‘India’ as checked one.

  • What hardware and software is needed to use share point 2010

    Please if enyone could help!
    I want to become familiar with the advantages of using excel for example simultaneusly with other users, shere point does it best for us yes???  What do I need to install or what hardware is needed to do that?
    Thanks,

    Here are the hardware and software requirements for SharePoint
    http://technet.microsoft.com/en-us/library/cc262485(v=office.14).aspx
    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

  • Adding metadata to a list in sharepoint hosted apps

    Hi,
    I created a share point hosted app and i added a custom list with columns.Now i need to add some metadata to the list through app only.How can i achieve this requirement.Please help me.Thanks in advance.
    Regards,
    Praveen

    Check if below article help you:
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/1f8bf097-7322-4a37-8ec2-916ba6cb1ac2/upload-the-metadata-of-a-file-to-sharepoint-programmatically?forum=sharepointdevelopmentlegacy
    Also if can be more specific about what metadata you want to add and where exactly, we can talk better

  • Sharepoint provider hosted app using angularjs

    I am working on a provider hosted app and trying to access the list item through REST call using angularjs. But I am not able to access the list. Is it possible to access the sharepoint list through REST call using angularjs in a provider hosted app?
    Below is the code for angular:
    var hostWebApp = angular.module('HostWebList', []);
    Service:
    hostWebApp.service('$SharePointJSOMService', function ($q, $http) {
        this.getListItems = function ($scope, listTitle) {
            var deferred = $q.defer();
            //First we must call the EnsureSetup method
            JSRequest.EnsureSetup();
            var hostweburl = decodeURIComponent(JSRequest.QueryString["SPHostUrl"]);
            var appweburl = decodeURIComponent(JSRequest.QueryString["SPAppWebUrl"]);
            var restQueryUrl = hostweburl + "/_api/web/lists/getbytitle('ListName')/items";
            var executor = new SP.RequestExecutor(hostweburl);
            executor.executeAsync({
                url: restQueryUrl,
                method: "GET",
                headers: { "Accept": "application/json; odata=verbose" },
                success: function (data, textStatus, xhr) {
                    deferred.resolve(JSON.parse(data.body));
                error: function (xhr, textStatus, errorThrown) {
                    alert("request failed");
                    alert(textStatus);
    //getting -1003
                    alert(JSON.stringify(xhr));
    //{"responseAvailable":false,"body":,"Header":null}
                    deferred.reject(JSON.stringify(xhr));
            return deferred.promise;
    Controller:
    hostWebApp.controller('HostWebListController', function ($scope, $SharePointJSOMService) {
        $scope.listItem = null;
        var listName = "IncomingEmail";
        var promise = $SharePointJSOMService.getListItems($scope, listName);
        promise.then(function (data) {
            $scope.listItem = data.d.results;
            alert($scope.listItem);
            console.log("came inside the promise success method");
        }, function (data) {
            console.log("Error " + data);
    Following javascript files I have included:
     <script type="text/javascript" src="/_layouts/15/sp.runtime.js"></script>
      <script type="text/javascript" src="/_layouts/15/sp.js"></script>
     <script type="text/javascript" src="/_layouts/15/SP.RequestExecutor.js"></script>
     <script type="text/javascript" src="/_layouts/15/init.debug.js"></script>
    angular.js included. 
    I don't know what is the problem. Can anybody walk me through the problem. will be great help.

    Your REST request must be authenticated. So you must send the access token in the authorization header along with your request. The following link explains how you can get the access token when you using a provider hosted app.
    http://blog.mastykarz.nl/using-sharepoint-rest-api-in-provider-hosted-apps/
    Blog | SharePoint Field Notes Dev Tools |
    SPFastDeploy | SPRemoteAPIExplorer

  • How to get the current user name in Provider hosted app using appOnlyAccessToken

    Hi, 
    Please help me, how to get the HostWeb UserName in Provider Hosted App
    i have Provider hosted App, and Anonymous Authentication is enabled on AppWeb, using appOnlyAccessToken
    Below code does not return current user who Log in in hostweb, it is returning
    SharePoint App (app@sharepoint)
    Web web = clientContext.Web;
    clientContext.Load(web);
    clientContext.ExecuteQuery();
    clientContext.Load(web.CurrentUser);
    clientContext.ExecuteQuery();
    clientContext.Web.CurrentUser.LoginName;
    Below code gives a blank name when Anonymous Authentication is enabled, if Anonymous Authentication is disabled
    app prompts for credentials 
    HttpContext.Current.User.Identity.Name
    Thanks
    Ram

    Hi,
    Since you are using a provider Hosted app if you want to get the current logged in name than do not use AppOnlyAccessToken else use AccessToken which is App + user Context AccessToken.
    then 
    Web web = clientContext.Web;
    clientContext.Load(web);
    clientContext.ExecuteQuery();
    clientContext.Load(web.CurrentUser);
    clientContext.ExecuteQuery();
    clientContext.Web.CurrentUser.LoginName;will return proper user Name.
    HttpContext.Current.User.Identity.Name will never return the user as this object is related to IIS server of your App Server not sharepoint.you should set this as Anonymous in case of provider hosted app.you can download the below sample which uses the AccessToken which has user name in it.https://code.msdn.microsoft.com/Working-provider-hosted-8fdf2d95
    Whenever you see a reply and if you think is helpful,Vote As Helpful! And whenever you see a reply being an answer to the question of the thread, click Mark As Answer

  • Provider hosted app - Site Provisioning activities

    Hi ,
    I am creating a Provider hosted app which does site provisioning activities like create site , create site columns, content types etc. I have almost 50 or more fields to be added. I am using the Provider hosted app - Process Event, and used SPRemoteEventType
    - App Installed.
    When the app is installed the above functionalities are done, as I need to code to do these activities synchronously.
    I am facing an issue in App Installed event that,during the code execution (consider the field creation method), since it takes some time to add all the fields, after some time limit,  the runtime comes to the start point of code execution , which is
    creation of token helper, and the methods already executed is also called again.
    I have executed the code in Release mode, the logs show the above behavior.
    I am not sure how I am getting this weird behavoir.
    Please advise.

    msdn (Handling events in apps for SharePoint):
    Your implementation of the App Installed event must complete and return an SPRemoteEventResult object
    within 30 seconds or the SharePoint installation infrastructure will think it has failed. The infrastructure will rerun the event, and repeat your code from the beginning, up to four times. After four timeouts,
    SharePoint will roll back the entire app installation. We recommend the following practices:
    If there is any code in your handler that should not be repeated after a timeout, put it in a conditional block that tests to see if it has already run. You must test the actual installed component. Simply setting
    a variable to true when a block of code completes does not work as a test because all variables are reinitialized when the event times out and restarts.
    Move installation code that takes more than 30 seconds into the app itself. You can add it to "first run" logic that executes the first time the app is launched. Alternatively, the app can prompt the
    user to run the installation code.
    If the preceding bullet item is not feasible for your app, another option is to have your event handler start a remote asynchronous process and then immediately return a SPRemoteEventResultobject.
    A weakness of this strategy is that if the remote process fails, it has no way to tell SharePoint to roll back the app installation.
    [custom.development]

  • Share Point 2013 Designer not showing platform as "Share point 2013 Workflow" at the time of workflow creation.

    Hi All,
    I am trying to create workflow for my Share Point 2013 site. To do this, I installed Share Point 2013 Designer,
    then created couple of workflows in that, using "Share point 2013 Workflow" platform.
    But when today, I tried to create workflow, I found that "Share point 2013 Workflow"  platform option was not there. Because of that I am unable to create and deploy workflow on my SP 2013 site.
    I am really not getting the problem. As I created some workflows using "Share point 2013 Workflow"  platform on same share point designer and now I dont see that option in dropdown.
    Please suggest me something for this. I tried all possible solution which are present on internet.
    Thanks in advance.

    Hi,
    Since you are posting the thread in SharePoint 2013 server forum, I assume you are using SharePoint server 2013.
    I understand the option SharePoint 2013 platform disappears when you create a workflow in Designer, the issue might be caused by workflow manager. Please refer to the article below and check workflow configuration per the steps listed:
    http://techbrij.com/the-option-sharepoint-2013-workflow-platform-not-available
    Regards,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected] .
    Rebecca Tu
    TechNet Community Support

  • How to get hostweb's site collection in SharePoint hosted app?

    I want display SharePoint site collection of host web in my SharePoint hosted app. I have used following code. 
    ExecuteOrDelayUntilScriptLoaded(callSharePoint, "sp.js");
    function callSharePoint() {
    hostweburl = getQueryStringParameter("SPHostUrl");
    appweburl = getQueryStringParameter("SPAppWebUrl");
    hostweburl = decodeURIComponent(hostweburl);
    appweburl = decodeURIComponent(appweburl);
    var scriptbase = appweburl + "/_layouts/15/";
    $.getScript(scriptbase + "SP.Runtime.js",
    function () {
    $.getScript(scriptbase + "SP.js",
    function () {
    //$.getScript(scriptbase + "SP.Taxonomy.js", function () { });
    $.getScript(scriptbase + "SP.RequestExecutor.js", execOperation);
    //Loads context, web and lists....
    function execOperation() {
    try {
    //create context for appweburl.
    context = new SP.ClientContext(appweburl);
    var factory = new SP.ProxyWebRequestExecutorFactory(appweburl);
    context.set_webRequestExecutorFactory(factory);
    //get hostsite reference & load as web.
    appContextSite = new SP.AppContextSite(context, hostweburl);
    web = appContextSite.get_web();
    context.load(web);
    list = web.get_lists();
    context.load(list);
    webs = appContextSite.get_web().get_webs();
    context.load(webs);
    //webs = appContextSite.get_site().get_rootWeb().get_webs();
    //context.load(webs);
    context.executeQueryAsync(onWebsLoaded, onQueryFailed);
    catch (err) {
    alert(err.message);
    function onWebsLoaded(sender, args) {
    alert(list.get_count());
    var webEnum = list.getEnumerator();
    while (webEnum.moveNext()) {
    web = webEnum.get_current();
    alert(web.get_id());
    for (var i = 0; i < webs.get_count() ; i++) {
    subwebs = webs.itemAt(i);
    recursiveAll(subwebs);
    /* recursive call for web */
    function recursiveAll(cweb) {
    debugger;
    alert(cweb.get_title());
    var subwebs = cweb.get_webs();
    context.load(subwebs);
    context.executeQueryAsync(function (sender, args) {
    debugger;
    var webEnum = subwebs.getEnumerator();
    while (webEnum.moveNext()) {
    web = webEnum.get_current();
    alert(web.get_title());
    //recursive call for current web.
    recursiveAll(web);
    }, function () { debugger; alert('err'); });
    In this code I have get all the list of the Host web. But I am not able to get Host webs.
    Any of the when I load the Web it gives me the AppWebUrl not the host web.
    So I tried by using following code
    context = new SP.ClientContext(hostweburl);
    web = appContextSite.get_web();
    context.load(web);
    context.executeQueryAsync(onWebsLoaded, onQueryFailed);
    But it gives me error: unexpected response data from server
    Is there any other way to view all sites and sub sites of the host web in SharePoint hosted app?

    Hi,
    Since you are using a provider Hosted app if you want to get the current logged in name than do not use AppOnlyAccessToken else use AccessToken which is App + user Context AccessToken.
    then 
    Web web = clientContext.Web;
    clientContext.Load(web);
    clientContext.ExecuteQuery();
    clientContext.Load(web.CurrentUser);
    clientContext.ExecuteQuery();
    clientContext.Web.CurrentUser.LoginName;will return proper user Name.
    HttpContext.Current.User.Identity.Name will never return the user as this object is related to IIS server of your App Server not sharepoint.you should set this as Anonymous in case of provider hosted app.you can download the below sample which uses the AccessToken which has user name in it.https://code.msdn.microsoft.com/Working-provider-hosted-8fdf2d95
    Whenever you see a reply and if you think is helpful,Vote As Helpful! And whenever you see a reply being an answer to the question of the thread, click Mark As Answer

  • How to use same credentials in third party web page/app/system as in Office 365 and Share Point?

    I want my users to be able to login with same username/password in my reporting system as in they use for their email, office 365 and share point.
    Since the web is in PHP i found some ideas that use CURL to get the cookie but i['m wondering if there is another way to do that?
    All API show cases and docs that i looked are so confusing that i can't even figure out if it is possible at all and how. It would be great to be able to reset passwords through my system and also to create new users. So that i have all centralized in one
    place.

    Hi,
    Here is an article which describes how to create and configure a single tenant PHP application that uses the single sign-on capabilities of Azure Active Directory.
    http://azure.microsoft.com/en-us/documentation/articles/active-directory-php-web-single-sign-on/
    A sample that shows how to use Azure Active Directory and single sign-on for PHP web sites is available at
    https://github.com/WindowsAzure/azure-sdk-for-php-samples/tree/master/WAAD.WebSSO.PHP 
    Regards,
    Rebecca Tu
    TechNet Community Support

  • Deployed lists in a SharePoint hosted app use the wrong content type.

    I am using Visual Studio Ultimate 2013 to deploy a SharePoint hosted app to my SharePoint 2013 development environment. 
    I have created 2 lists, one of which is using a custom content type with custom columns and the other is just a simple custom list definition and instance, all of which are deployed inside the same feature.
    However when I go to the simple list, it is using the content type from the other list, even though in the schema.xml shows that it is not supposed to use this content type. I have checked the content type ID and it is not referencing my custom content type,
    but for some reason the list is using that content type.
    I remember seeing this same issue a few months ago while creating a SP2010 sandbox solution. It could well be something I'm doing wrong when creating the lists/content type.
    Steps to recreate this issue:
    Create a SharePoint hosted app in VS
    Create some custom fields
    Create a custom content type
    Create a list based on that content type
    Create another list not based on the content type
    Delete feature that VS creates for the second list and add the list def and instance to the main feature (containing the other list and content type)
    Deploy and go to second list, note that it has the custom fields from the first list.
    Any advice on what to do about this would be great. I have tried deleting the list and recreating it in VS several times but that didn't work.
    Thanks
    David

    Hi
    I have now tested against a trail Office  365 Developer site and I had to make a few adjustments
    - change the url
    - change the target to SharePoint Onlne
    - change the url 
    I still wasn't happy so I created a new SharePoint Hosted app and pointed at the above developer site.  I copied my CrossDomainExec.js and stripped all my code except my CopyItemInSameLIbrary method which hasn't changed since I created this post. 
    - changed the App Manifest permissions to Web -full Control ( was previously tenant)
    I still got errors which is really painful as you don't even see the POST request in Fiddler
    The URL used for my POST is as follows ( note host URL is fictitious)
    "https://myapphell-547d8061d39e38.sharepoint.com/sites/appsdev/RESTTestSHA/_api/SP.AppContextSite(@target)/web/Getfilebyserverrelativeurl('/sites/appsdev/Shared Documents/SrcDoc.docx')/copyTo(strNewUrl='/sites/appsdev/Shared Documents/DestDoc.docx', bOverWrite=true)?@target='https://myapphell.sharepoint.com/sites/appsdev'" String
    Ran the app a second time and now I see......Wow it WORKS!!!!!! ..Can't be true can it?
    .... next I will switch the target url to my on prem farm to see if this still works so watch this space!
    Daniel
    Freelance consultant

  • Change the Page title of Default.aspx in SharePoint Hosted App using ECMA Script

    Basically i want to change page title dynamically. the thing is default.aspx page is present in the below location
    Folders/Pages/Default.aspx ( Verified using
    SharePoint Manager 2013 Online )
    Could any one let me know how to iterate through the folders and then go to pages and change title of Default.aspx page?
    Navaneeth

    All the links which is mentioned above is either they are doing it in code behind or javascript like document.title.
    I want to change dynamically using ECMA script. the point i found here is if you use the below code you will get an error saying list "Pages" does not exists in the SharePoint site.
    clientContext.Web.Lists.GetByTitle("Pages");
    So i am wondering how can we change the page title of SharePoint hosted app ( Default.aspx) dynamically
    Say example i have one text box and submit button. when give the title in the text box and click on submit  the title should reflect in the page.
    Navaneeth

  • My itunes 11 Home sharing is not working with my windows 7 PC and iPad it shows up on iPad and when I go to share the music app does loading for 3 mins and crashes I am using a virgin super hub router please please please help

    My itunes 11 Home sharing is not working with my windows 7 PC and iPad it shows up on iPad and when I go to share the music app does loading for 3 mins and crashes I am using a virgin super hub router please please please help

    My itunes 11 Home sharing is not working with my windows 7 PC and iPad it shows up on iPad and when I go to share the music app does loading for 3 mins and crashes I am using a virgin super hub router please please please help

  • How to get list data and bind to data table or Grid view in share point 2010 using j query

    hi,
    How to bind list data in to data table or  grid view  using Sp Services.
    How to use sp services in share point 2010 lists and document library 

    Hi, You can use List service, SPServices and JQuery to get your requiement done-
    See here for an sample implementation -
    http://sympmarc.com/2013/02/26/spservices-stories-10-jqgrid-implementation-using-spservices-in-sharepoint/
    http://www.codeproject.com/Articles/343934/jqGrid-Implementation-using-SpServices-in-SharePoi
    Mark (creator of SPServices) has some good documentation on how to use SPServices-
    http://spservices.codeplex.com/wikipage?title=%24().SPServices
    SPServices Stories #7 – Example Uses of SPServices, JavaScript and SharePoint
    http://sympmarc.com/2013/02/15/spservices-stories-7-example-uses-of-spservices-javascript-and-sharepoint/
    Hope this helps!
    Ram - SharePoint Architect
    Blog - SharePointDeveloper.in
    Please vote or mark your question answered, if my reply helps you

Maybe you are looking for

  • If your remote will not connect, read this, it will most likely help you.

    If your remote is not connecting, I can almost guarantee it is because you need to forward the ports on your router necessary to control it. I've suggested it to MANY people, and it has helped 100% of them. You need to forward ports TCP 3689 and UDP

  • Verizon and it's lack of custoemr focus.

    I have had one of the most difficult and frankly worst customer experience with verizon I can recall in recent history. I have compliand several times about my verizon locking up and needing to rebooted at least 2 or 3 times a day. If the modem does

  • Material Creation date by plant

    Hello all, In several of our report I need to enter the creation date of the material. My problem is that the creation date of material is a global information and sits in MARA. The users run the report by plant and therefore they are interested to k

  • Rewards dashboard will not load

    When I go to https://www.bing.com/rewards/dashboard I get an error: The page you want isn't available We're working to restore service as soon as possible. TRY THIS Refresh the page - it might be a momentary issue. If you get this message again, plea

  • Standard extractor for ECC table BFOD_A

    Dear Gurus, Do we have any standard extractor delivered by sap to extract data from ECC table "BFOD_A". Also this table does not have any timestamp field..so in case we create generic datasource on this table how to do we extract delta. Thanks, Sande