Get list items using spservices for sharepoint 2013

Hi,
I have a requirement like below.
I have 2 sharepoint custom list with some columns.
List1:listA
List2:listB
Now when i open the listB new item form i want some of the field values from listA should auto populate in Textboxes of listB new form.
Is there any ways to implement this?
Regards,
Poovi

Hi Poovi,
You can achieve this using jQuery to get the SharePoint list items. Refer the below articles. It has explained how to get list items using jQuery and auto populate a text-box from a list item as a source.
You can put this code in list forms through SharePoint Designer. The articles explain about auto populating text box of web part but similarly you can implement it for list form, because nevertheless the text boxes are same.
http://www.c-sharpcorner.com/UploadFile/sagarp/sharepoint-2010-jquery-autocomplete-textbox-containing-list/
http://tomvangaever.be/blogv2/2011/07/sharepoint-2010-autocomplete-with-list-items/
Please remember to click 'Mark as Answer' if the reply answers your query or 'Upvote' if it helps you.

Similar Messages

  • Uploading multiple documents into sharepoint list item with REST in sharepoint 2013 using content editor web part :

    hi ,
    i am trying to upload multiple document files into sharepoint list item. I followed below link for implementaion.
    http://techfindings-prem.blogspot.in/search/label/jquery.multifilejs
    It was working for sharepoint hosted app.
     This complete code is written within content edito web part.
    It was working when i was in root site collection with below change (hard coded the root level url) in code in "UploadFile" function.
    var scriptbase = "http://servername" + "/_layouts/15/";
                console.log(' File size:' + bytes.length);
                $.getScript(scriptbase + "SP.RequestExecutor.js", function () {
                    var createitem = new SP.RequestExecutor("http://servername");
                    createitem.executeAsync({
                        url: "http://servername/sites/cpg/" + "/_api/web/lists/GetByTitle('SalesRecord')/items(" + attachmentitemid + ")/AttachmentFiles/add(FileName='"
    + fileName + "')",
                        method: "POST",
                        binaryStringRequestBody: true,
                        body: binary,
                        success: fsucc,
                        error: ferr,
                        state: "Update"
                    function fsucc(data) {
                        //alert( data.statusText + "\n\n" + data.responseText);
                        console.log(data + ' uploaded successfully');
                        deferred.resolve(data);
                    function ferr(data) {
                        //alert( data.statusText + "\n\n" + data.responseText);
                        console.log(fileName + "not uploaded error");
                        deferred.reject(data);
    But the issue came in picture when i was working with the other site collection instead of root one. The url was like below.
    "http://servername/sites/cpg/". This time i need to be there within "cpg" site collection. 
    Now if i hard code the url as i did above my code gets break here while come to below line
     $.getScript(scriptbase + "SP.RequestExecutor.js", function () {
    I am getting error when i used below code:
    var scriptbase = "http://servername" + "/_layouts/15/";
     $.getScript(scriptbase + "SP.RequestExecutor.js", function () {
                    var createitem = new SP.RequestExecutor("http://servername");
                    createitem.executeAsync({
                        url: "http://servername/sites/cpg/" + "/_api/web/lists/GetByTitle('SalesRecord')/items(" + attachmentitemid + ")/AttachmentFiles/add(FileName='"
    + fileName + "')",
                        method: "POST",
                        binaryStringRequestBody: true,
                        body: binary,
                        success: fsucc,
                        error: ferr,
                        state: "Update"
                    function fsucc(data) {
                        //alert( data.statusText + "\n\n" + data.responseText);
                        console.log(data + ' uploaded successfully');
                        deferred.resolve(data);
                    function ferr(data) {
                        //alert( data.statusText + "\n\n" + data.responseText);
                        console.log(fileName + "not uploaded error");
                        deferred.reject(data);
    Please hekp in this case. This complete code is written within content edito web part. 
    Regards:
    Sanjay Joshi

    Hi,
    According to your post, my understanding is that you have an issue about upload multiple documents files into library vai REST API.
    As you have said, you have used the hard code url in your code.
    How about use the _spPageContextInfo.webAbsoluteUrl method to get the url?
    I have used this method to get the url, then use the code in the article you have pasted within a content editor web part to upload the files.
    You can replace the hard code url with the _spPageContextInfo.webAbsoluteUrl method, then check whether it works.
    Thanks,
    Jason
    Jason Guo
    TechNet Community Support

  • Open Edit form directly when list item is clicked in Sharepoint 2013 list

    Hi,
    I have a list web part, wherein the user clicks the item it should open in the Edit form directly. various forum i checked was for SharePoint 2010, as we do not have design mode in SharePoint designer 2013, I am unable to do.. I know
    if I the change the form type from default page to edit page, it will work, but not sure about how to go ahead. Could anyone help me to achieve this please....

    Sunitha,
    You can do this with some jQuery and JavaScript.  Look at this post:
    http://brandonatkinson.blogspot.com/2013/11/open-sharepoint-2013-list-items.html
    Basically, add a Script Editor Web Part to the page and include this snippet:
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
    <script type="text/javascript">
    $(function() {
    // Change all display form links to edit form links
    $('.ms-vb a[href*="listform.aspx"]').each(function(){
    var link = $(this).attr('href');
    link = link.replace("PageType=4", "PageType=6");
    $(this).attr('href', link);
    </script>
    Brandon Atkinson
    Blog: http://brandonatkinson.blogspot.com

  • Create a ready to use image for SharePoint 2013 development environment.

    Hi 
    I have a requirement in which we are required to have an Image of the whole SharePoint 2013 environment, (ideally single server installation/standalone as I believe multi-tier would not be possible, or if possible suggest on that also), with all the installations
    done- SQL server, SharePoint , language pack if any, App configured, search, service applications, etc etc. so that if at all required we would have that image in a server and provide that image to the developer, he would either mount it or run it and start
    the SharePoint 2013 App development.
    Please suggest on this.
    Thanks in advance.

    Not for imaging purposes.
    You could have an environment that is ready-to-go with the bits installed, but not configured. You would then have a post-imaging script that would configure the farm. In this process, you would also need to make sure SQL Server was aware of the server's
    new name (see http://technet.microsoft.com/en-us/library/ms143799.aspx).
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • Get the item level permission in sharepoint 2013 uisng rest api

    I created the test list  and i created the 5 items in that list.
    I stopped the item level permissions.
    I shared the list item with userA.
    In the rest api response, it giving the other users also (means user who is not having permission to the item).
    I am using below rest query
    /_api/Web/GetFileByServerRelativeUrl('/site/Lists/test/1_.000')?$expand=Versions,Author,ModifiedBy,ListItemAllFields/RoleAssignments/Member/Users,ListItemAllFields/FieldValuesAsText,ListItemAllFields/ParentList

    Hi,
    Following are the steps, I performed:
    After adding the item in the list, I went into list item permissions and clicked on stop item permissions. Then I selected all the permissions which got carried over to the item and clicked on "Remove user permissions" in the ribbon. After that
    I clicked on Grant permissions in the ribbon and shared the item with one user. Note that last action can also be performed by going back into the list and selecting the item and click on Share.
    Finally, I ran the above REST query and returned the user with whom the item was selected and also the system account (which is expected, as admin will have access.
    You can try shortening your query as well
     /_api/Web/GetFileByServerRelativeUrl('/site/Lists/test/1_.000')?$expand=ListItemAllFields/RoleAssignments/Member/Users
    This will return the relevant user permissions and response will contain lesser data and hence will be easier to read. Lastly, try intercepting the traffic
    using fiddler, as again it will in reading the response.
    Thanks,
    Nadeem
    Please remember to up-vote or mark the reply as answer if you find it helpful.

  • Create List Item using REST API

    Hi All
      I try create list item using REST in SharePoint 2013.  when code is try add new item in list , getting error :
    A node of type 'EndOfInput' was read from the JSON reader when trying to read the start of an entry. A 'StartObject' node was expected.
    Please help me
    function addData() {
    var title = $('#txtTitile').val();
    //alert(title);
    var items = {
    __metadata: { "Type": "SP.Data.OrderDetailsListItem"},
    Title:title
    var exec = new SP.RequestExecutor(appweburl);
    exec.executeAsync(
    url: appweburl + "/_api/SP.AppContextSite(@target)/web/lists/getbytitle('OrderDetails')/Items?@target='" + hostweburl + "'",
    method: "POST",
    data: JSON.stringify(items),
    headers: {
    Accept: "application/json;odata=verbose",
    "Content-Type": "application/json;odata=verbose",
    "X-RequestDigest": $("#__REQUESTDIGEST").val()
    success: function (data) { alert(JSON.parse(data)); },
    error: function (error)
    { alert(JSON.stringify(error)); }
    with Regards Sivam

    Hi,                                                             
    Here is a demo which works in my environment for your reference:
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function()
    $("#Button1").click(function(){
    createListItemWithDetails("list2", "http://sp2013sps", "item1");
    // Getting the item type for the list
    function GetItemTypeForListName(name) {
    //alert("GetItemTypeForListName: "+name);
    return"SP.Data." + name.charAt(0).toUpperCase() + name.slice(1) + "ListItem";
    // CREATE Operation
    // listName: The name of the list you want to get items from
    // siteurl: The url of the site that the list is in. // title: The value of the title field for the new item
    // success: The function to execute if the call is sucesfull
    // failure: The function to execute if the call fails
    function createListItemWithDetails(listName, siteUrl, title) {
    var itemType = GetItemTypeForListName(listName);
    //alert("itemType :"+itemType);
    var item = {
    "__metadata": { "type": itemType },
    "Title": title
    $.ajax({
    url: siteUrl + "/_api/web/lists/getbytitle('" + listName + "')/items",
    type: "POST",
    contentType: "application/json;odata=verbose",
    data: JSON.stringify(item),
    headers: {
    "Accept": "application/json;odata=verbose",
    "X-RequestDigest": $("#__REQUESTDIGEST").val()
    success: function (data) {
    location.href=location.href;
    //success(data);
    error: function (data) {
    alert("error");
    //failure(data);
    </script>
    <input id="Button1" type="button" value="Run Code"/>
    Best regards
    Patrick Liang
    TechNet Community Support

  • Rating a List Item using jquery with out using User profile service

    Hi,
    I dont have access to Central admin and i was not not able to enable USer profile service.
    can i rate a list item in Sharepoint 2010 using any jquery plugin
    i got the link
    http://blogs.msdn.com/b/carloshm/archive/2009/08/24/jquery-rating-in-sharepoint-lists.aspx
    But i am not able to find any plugin in it.
    Please advice.
    Thnaks,
    Pallavi

    Hi,
    According to your post, my understanding is that you wanted to rate a list item using JQuery in SharePoint 2010.
    The link you had posted above is for SharePoint 2007.
    You can refer to the following articles which about using the JQuery to call the rating service.
    http://blog.dennus.net/2011/08/09/using-spservices-and-jquery-to-include-social-rating-control-on-_layouts-page/
    https://www.habaneroconsulting.com/insights/Calling-the-Rating-Service-using-jQuery-in-SharePoint-2010-Part-1-of-2#.UxbQxvmSz6k
    You can also use the tool of the CodePlex to achieve it.
    http://sptoolbasket.codeplex.com/
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • SharePoint 2013 document generation from list items using workflow

    I have been able to generate docs from list items using sharepoint designer workflow.But i have been able to do this with using one document template. But i have like 6 templates i would like to use what do i need to do to get this rolling would i need to
    have 6 different doc libs with a doc template?
    Thanks in Advance

    Thanks Sharma.
    I have create 6 content type and associated doc templates to them. I read I should be using .docx instead of dotx which I also tried
    But im still getting the error
    When I click details no error details  to help at all.
    Can anyone who is having this issue help or give me some hints.
    Cheers

  • Getting error while publishing workflow using SP designer for SharePoint 2013

    Hi,
    I am try to setup Workflow manager for our sharepoint applications.
    WF manager set ran without any issue.
    I registered the SPWorkflow service which succeeded as well. The Workflow service application shows "Workflow is connected"
    I am creating a workflow using sharepoint designer using my credential (not Service account). I am able to save it but while publishing, its prompting with an error.
    The error says "Errors were found while compiling the workflow.The workflow files were saved but cannot run." Clicking advanced button show
    "Microsoft.SharePoint.SPException: We're sorry, we weren't able to complete the operation, please try again in a few minutes. If you see this message repeatedly, contact your administrator.
       at Microsoft.SharePoint.SPScaleOutDatabaseMap.CreateSqlSession(ISPScaleOutDatabaseMapProvider mapProvider, Byte[] compositeKey, Guid forceRefreshVersion, Guid& version)
       at Microsoft.SharePoint.SPScaleOutDatabaseCommandExecutor.Execute(ExecuteDelegate operation, ISPScaleOutDatabaseMapProvider mapProvide"
    Any help would be highly appreciated
    Thanks,

    Hi,
    According to your post, my understanding is that you got error while publishing workflow using SharePoint designer for SharePoint 2013.
    Please check whether the Central Admin > Manage Service Application-> “App Management Service” is started.
    Please check whether the “Configure service application associations”,  ”App Management Service” is already associated.
    Then please check whether the “Manage Services on server” and the “App Management Service” is started.
    In addition, please try to re-register Workflow Service.
    If the issues still exists, please follow the steps in the
    Steps to Verify that Server Is Correctly Set Up. After you verified that the server is correctly set up, follow the steps in the
    Steps to Troubleshoot Workflow Management Service and
    Troubleshooting the Service Bus for Windows Server then retry your action related to publishing workflows
    More information:
    http://wp.ahcheng.com/2013/03/23/error-were-found-when-compiling-the-workflow-the-workflow-files-were-saved-but-cannot-be-run/
    http://sp2013.pro/2013/04/solution-errors-were-found-when-compiling-the-workflow-the-workflow-files-were-saved-but-cannot-be-run-cannot-set-unknown-member/
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • SSIS List Adaptors for SharePoint 2013

    Was wondering if anyone is using the SSIS SharePoint List Adapters with SharePoint 2013 ?  We are interested in using them, but wasn't able to get information on support for SharePoint 2013 and the api's used (ASMX vs WCF web services). 
    https://sqlsrvintegrationsrv.codeplex.com/documentation
    https://msdn.microsoft.com/en-us/library/hh368261.aspx
    Thank you in advance for any help. 
    Tom
    Tom H.

    Hi Tom,
    Based on my test, we can use SSIS SharePoint List Adapters for SharePoint 2013.
    The following steps test in my environment are for your references:
    Download and Install SharePointListAdaptersSetup.msi or SharePointListAdaptersSetup_x86.msi.
    Right-click the SSIS Toolbox pane to Refresh Toolbox, then we can see SharePoint List Source and SharePoint List Destination under Common group.
    Create a SharePoint connection as SharePoint Credential in the package.
    Double-click SharePoint List Source or SharePoint List Destination to open the dialog box.
    Select the SharePoint Credential as Connection Manager in the Connection Managers pane.
    In the Component Properties pane, paste the URL for the SharePoint site into the SiteUrl (exclude anything from the word Lists onward in the URL)
    Example: if your SharePoint site URL for Lists is
    http://sp2k13/sites/report/Lists/11/AllItems.aspx
    then type http://sp2k13/sites/report as SiteUrl, type 11
    as SiteListName, type All Items as SiteListViewName.
    Finishing the mapping in the Column Mappings pane.
    The following screenshot is for your reference:
    Reference:
    How To Use a SharePoint List as a Data Source in your SSIS Package
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

  • Add list item using anonymous user in public website of shareopint 2013 office 365

    Can any body know the solution to over come of following error while add list item using anonymous user using CSOM in shareopint 2013 office 365 public website.
    I have tried following solution to narrow down the error from "Access permission"
    http://sharepointtaproom.com/2014/08/28/anonymous-api-access-for-office-365-public-sites/#comment-2304

    Try below:
    http://www.codeproject.com/Articles/785099/Publish-a-Form-for-Anonymous-Users-on-a-Public-Sit
    http://blogs.technet.com/b/sharepointdevelopersupport/archive/2013/06/13/how-to-allow-anonymous-users-to-add-items-to-sharepoint-list-using-client-object-model.aspx
    // Allows AddItem operation using anonymous access
    private
    static voidAllowAnonAccess(){
    Console.WriteLine("Enabling Anonymous access....");
    SPWebApplication webApp =
    SPWebApplication.Lookup(new
    Uri(webAppUrl));
                webApp.ClientCallableSettings.AnonymousRestrictedTypes.Remove(typeof(Microsoft.SharePoint.SPList),
    "GetItems");
                webApp.ClientCallableSettings.AnonymousRestrictedTypes.Remove(typeof(Microsoft.SharePoint.SPList),
    "AddItem");
                webApp.Update();
    Console.WriteLine("Enabled Anonymous access!");  
    // Revokes Add/Get Item operation using anonymous access
    private static
    voidRemoveAnonAccess(){
    Console.WriteLine("Disabling Anonymous access....");
    SPWebApplication webApp =
    SPWebApplication.Lookup(new
    Uri(webAppUrl));
                webApp.ClientCallableSettings.AnonymousRestrictedTypes.Add(typeof(Microsoft.SharePoint.SPList),
    "GetItems");
                webApp.ClientCallableSettings.AnonymousRestrictedTypes.Add(typeof(Microsoft.SharePoint.SPList),
    "AddItem");
                webApp.Update();
    Console.WriteLine("Disabled Anonymous access!"); 
    http://www.fiechter.eu/Blog/Post/12/Create-a-survey-for-anonymous-users-on-Office-365
    If this helped you resolve your issue, please mark it Answered

  • Need to update the list item in the same sharepoint list with particular condition with Sharepoint Designer 2013.

    Hi All
    I have one sharepoint list with huge data i.e with 20columns and more than 200 records with the fields .
    Suppose lets consider there are A,B,C,D,E,F,G,H columns.
    Now i want to create one form with the fields A,C,E.
    When the user enter the existing data of list for columns A,C..based on C value the E column value should change and update that particular item in the list.
    Please guide me without visual web part can we acheive this by Sharepoint designer 2013 or what would be the preferable solution.
    Please help me on this as it is very urgent from me..
    Thanks in Advance
    Sowjanya G

    Hi,
    According to your post, my understanding is that you wanted to update the list item in the same sharepoint list with particular condition with Sharepoint Designer 2013.
    I recommend to create workflow associated to the list and then start the workflow automatically when an item is changed.
    In the workflow, you can add condition and actions as below:
    If current item: C equal to Test1
         Set E to Test2
    Then the value of the filed E will be changed based on the value of the filed C.
    In addition, if you create the form using InfoPath, you can add rule to the filed C as below:
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Can we use SQL Server as a primary data storage for SharePoint 2013?

    Is it possible to use external SQL Server as a primary data storage for SharePoint 2013?
    Having this implemented we can generate reports, query data and it would become very very powerful to use.
    Or
    Is there a way to keep on using existing content databases and using external SQL Server as a secondary data storage at the same time. So I want it to be like redundant data in SQL Server.
    Thanks 

    Hi,
    Not sure if I understand your question correctly, SharePoint has its own content database storing SharePoint list data, we can use SSRS/SSAS integated with SharePoint mode to use sharepoint list as datasource to generate reports.
    http://technet.microsoft.com/en-us/library/bb326358(v=sql.105).aspx
    http://sqlmag.com/business-intelligence/delivering-bi-through-sql-server-and-sharepoint
    http://www.mssqltips.com/sqlservertip/2068/using-a-sharepoint-list-as-a-data-source-in-sql-server-reporting-services-2008-r2/
    Thanks
    Daniel Yang
    TechNet Community Support

  • Filter SharePoint list items using CAML query as same as Like operator in SQL Server.

    Hi ,
    I have filtered SharePoint list items based on Name using CAML query <Contains> . Now I have a new requirement is to filter list items using Like operator in SQL. But Like operator is not in CAML.
    How do I filter list items using CAML as same as Like operator in SQL.
    Please let me know.
    Thanks in Advance.

    Did you try using <Contains>?
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/15766fd5-50d5-4884-82a1-29a1d5e38610/caml-query-like-operator?forum=sharepointdevelopmentlegacy
    --Cheers

  • Reading list items using JQeury

    Hi All,
    I am new to JQuery. Please help me on reading the ListItems(for eg., title, name, location etc.,) using JQeury & wanted to display this data in a site page.
    Let me know if you have any queries.
    Thanks,
    Kumar.

    check this article on using REST and Jquery to get list items
    http://www.plusconsulting.com/blog/2013/05/crud-on-list-items-using-rest-services-jquery/
    you can use JSOM as well
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/8dda0580-c632-4c1b-92f0-59e1a3f29e5b/jquery-fetch-data-from-sharepoint-list-in-a-webpart
    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

Maybe you are looking for

  • Can I import my old link lists into 365 site?

    Hi I would like to import all my hard work from my old 2010 sharepoint site into the new 365 site. I exported my links to excel but I cannot see an import option on a link list in 365. Surely there must be an easy way to do this that I am missing? th

  • U410 recovery partition reformatted, need help reinstalling Windows 8

    Hi, I have a Lenovo U410 with a 32GB SSD and a 750GB HDD that are treated as one drive. The previous owner reformatted the entire drive, which erased the recovery partition. Thus, I can'tmake a recovery disc or USB stick (the recovery partition would

  • Syncing more than one device.

    I sync my iphone and my son's ipod touch to my mac. My son has now started using his calendar and adding events and also creating his own contacts. When I sync his ipod to my mac it puts all of his contacts and calendar events into my contacts and ca

  • Connecting Using SSL Authentication Without Username and Password

    Hi, We're on RedHat Linux 4.0 using 10.2.0.3 (server/client). We're trying to figure out a way to connect to the database using instantclient and JDBC-OCI and SSL authentication without using a username or password. According to the documentation thi

  • Best Practice connecting VmWare ESX with a Channel

    Hello which methode (fix,pagp or lacp) should I use with an ESX server and what other interesting point should I care about it? The customer would like to connect the ESX Server to a WS-4006 Chassis with WS-X4013 supervisor. many thanks for any input