ID in Document library in SharePoint 2013

Hi,
I have an document library in SharePoint 2013.I uploaded some documents to document library for testing.Now I deleted these testing documents.And when user starts adding documents,the id of the document  is not started from 1.
So how I will get the id starting from 1. 
Any help?
Thank you.

Save the list as a template and recreate the list usign this template. ID columns will always keep incrementing
and will never be reused.

Similar Messages

  • How do I show/refresh data from an Access Web App in an Excel spreadsheet saved in a Document Library on Sharepoint 2013 online

    I have an Access 2013 Web App in my Sharepoint 2013 online website. It contains a query to report on its data (several, actually, but let's keep it simple). I want to connect an Excel spreadsheet to the query, visualise the data in pivot tables/graphs/whatever,
    save the spreadsheet in a Document Library, and let other team site Sharepoint users open the spreadsheet (preferably in Excel online, but with Excel client if it has to be) and see/copy the data, refreshed with the latest information from the Access Web App.
    Simple, surely!
    The way I'm doing it at the moment is to create an ODC file to connect to the cloud-based Access 2013 database, save that ODC in a Data Connection Library in the SP site, and use the saved ODC file as data source in the Excel spreadsheet. This works and
    successfully keeps everything 'in the cloud' but I can't get it to refresh in Excel Online, and if I open the spreadsheet in Excel Client I have to enter the database password every time to refresh it. I don't really want to issue this password to everyone
    who might want to view the data. There must be a better way than this ODC method, I suspect.
    Googlings on this have led down various blind alleys - Excel Services, PowerPivots, Web Parts - but I'm stuck on which to follow through. Please, someone, point me to an article/book/website that explains how to do this step-by-step in simple language..
    thanks
    Jonathan

    I don't see any quick way of achieving it - at least there's no such functionality exists in SharePoint. All you can do, develop an event receiver that will update the fields in the list item once the excel file is added/updated. You can use OpenXml API
    to manipulate the excel file.
    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

  • Set unique file name for document library in SharePoint 2013

    Hi,
    I have document library in the sharepoint 2013 with two dropdown fields-dept name,dept id.
    My requirement is to create a namiing convention for each file uploded in the document library.
    So the naming convention should be "deptname-deptid-filename-Id".
    I tried this naming convention using workflow as below-
    In this case ,first I attach the file and then it asks for dept name & id,Whwn i input these value,it shows error message as this file is modified by you at this point of time.On cancel it saves the attached file but does not save the deptname and dept
    id.
    please help if any idea or suggestion.
    Thank you.

    The only way I've ever seen this work while adding a new file is to use an Event Reciever.  Build an Event 
    Receiver that fires whenever a file is added and have the code change the name of the file from whatever the user titled it to the naming convention you are using.  
    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.

  • Get/retreive managed metadata column value from Document Library using SharePoint 2013 JSOM

    Hi,
    I am trying to retrieve managed metadata column (NewsCategory) value in SharePoint 2013 Document library using JSOM.
    I get "Object Object" rather than actual value.
    I tried:-
    var newsCat = item.get_item('NewsCategory');
    alert(newsCat) //Displays [Object Object]
    var newsCatLabel = newsCat.get_label();
    var newsCatId = newsCat.get_termGuid();
    But, I get the error "Object doesn't support property or method get_label()"
    I also tried :-
    var newsTags = item.get_item(' NewsCategory ');
    for (var i = 0; i < newsTags.get_count() ; i++) {
    var newsTag = newsTags.getItemAtIndex(i);
    var newsTagLabel = newsTag.get_label();
    var newsTagId = newsTag.get_termGuid();
    Even now I get the error "Object doesn't support property or method get_count()"
    I have included " NewsCategory " in the load request:- context.load(items, 'Include(File, NewsCategory)');
    Any idea what the issue is? Do I have to add any *.js file using $.getScript?
    I added following .js files
    var scriptbase = _spPageContextInfo.webServerRelativeUrl + "/_layouts/15/";
    $.getScript(scriptbase + "SP.Runtime.js", function () {
    $.getScript(scriptbase + "SP.js", function () {
    $.getScript(scriptbase + "SP.Core.js", function () {
    Thanks in Advance,

    Hi Patrick,
    I already added those references. I just pasted the parts of script snippet in my initial post. To avoid confusion I am pasting here complete script.
    2.1.1.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){
    var scriptbase = _spPageContextInfo.webServerRelativeUrl + "/_layouts/15/";
    $.getScript(scriptbase + "SP.Runtime.js", function () {
    $.getScript(scriptbase + "SP.js", function () {
    $.getScript(scriptbase + "SP.Core.js", function () {
    function getdata() {
    var context = new SP.ClientContext.get_current();
    var web = context.get_web();
    var list = web.get_lists().getByTitle('Documents');
    var camlQuery = new SP.CamlQuery();
    var filterCategory = 'Solutions';
    var IDfromTaxonomyHiddenList = 15;
    camlQuery.set_viewXml('<View><Query><Where><Eq><FieldRef LookupId="TRUE" Name="'+filterCategory+'" /><Value Type="ID">' + IDfromTaxonomyHiddenList +'</Value></Eq></Where></Query></View>');
    /*the above CAML query successfully gets all the list items matching the criteria including "NewsCategory" managed metadata column values
    But when I try to display the value it retrieved it ouputs/emits Object Object rather than actual values */
    var items = list.getItems(camlQuery);
    context.load(items, 'Include(File,NewsCategory)');
    context.executeQueryAsync(
    Function.createDelegate(this, function (sender, args) {
    if (items.get_count() > 0) {
    var listItemEnumerator = items.getEnumerator();
    while (listItemEnumerator.moveNext()) {
    var oListItem = listItemEnumerator.get_current();
    var file = oListItem.get_file();
    var name = file.get_name();
    var newsCat = oListItem.get_item('NewsCategory'); alert(newsTags.constructor.getName());
    alert(newsCat) //Displays [Object Object]
    var newsCatLabel = newsCat.get_label(); // Here it errors out with message "Object doesn't support property or method get_label()"
    var newsCatId = newsCat.get_termGuid();
    } //end while
    }//end if
    Function.createDelegate(this, function (sender, args) {
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    ExecuteOrDelayUntilScriptLoaded(getdata, "SP.Core.js");
    </script>
    In the above script "var name = file.get_name(); " gets the exact file name.
    But the line "var newsCat = item.get_item('NewsCategory');
           alert(newsCat) //Displays [Object Object]  rather than actual value.
    Issue resolved replace "oListItem.get_item('NewsCategory');" with oListItem.get_item('NewsCategory').get_label();"
    Thanks

  • Retrieve all folder & sub folder from document library in sharePoint 2013

    Hi,
    I want to retrieve all the folder and sub folder from document library and bind it to the dropdownlist using server object model.
    I used the below query to get all folder and sub folder.\
    query.Query = @"<Query><Where><Eq><FieldRef
    Name='FSObjType' /><Value Type='Lookup'>1</Value></Eq></Where></Query>";
                      query.ViewAttributes
    ="Scope='RecursiveAll'";
                     query.ViewFields
    = "<FieldRef Name='Title'/>";
                      query.ViewFieldsOnly
    = true;
    but when I bind result with the dropdownlist,it displays the output as below
    Please Help
    Thank You

    Hi,
    Thanks for posting your issue, Kindly try out below mentioned CAML query to get all the Folders and Subfolders from Document Library
    <Query>
    <Where>
    <Contains>
    <FieldRef Name='FileLeafRef' />
    <Value Type='Text'>token</Value>
    </Contains>
    </Where>
    <OrderBy><FieldRef Name='FileDirRef' /></OrderBy>
    </Query>
    <ViewFields>
    <FieldRef Name='ID' />
    <FieldRef Name='LinkFilename' />
    <FieldRef Name='FileDirRef' />
    <FieldRef Name='FileLeafRef' />
    </ViewFields>
    <QueryOptions>
    <ViewAttributes Scope='Recursive' />
    <OptimizeFor>FolderUrls</OptimizeFor>
    </QueryOptions>
    Also, check out below mentioned URLs to fix this issue
    https://social.msdn.microsoft.com/Forums/office/en-US/35e799a1-9360-46e5-8719-dd35fdace7ea/filter-document-library-folder-through-caml-query?forum=sharepointdevelopmentlegacy
    http://www.ktskumar.com/blog/2009/07/retrieve-all-folders-from-list/
    I hope this is helpful to you, mark it as Helpful.
    If this works, Please mark it as Answered.
    Regards,
    Dharmendra Singh (MCPD-EA | MCTS)
    Blog : http://sharepoint-community.net/profile/DharmendraSingh

  • How to apply masterpage for document library in SharePoint 2013

    Hi,
    is it possible to change the master page in library level.

    DO you mean JUST at the library level?  If so, there's no way that I know of as Master Pages are applied to Sites at a whole.  They then have Page Layouts added, which tell SharePoint where to load the content, which is where your document library
    would be.
    What do you hoping to achieve?
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • Not moving the .pdf files from Drop Off Library to my custom document library in sharepoint 2013

    Hi Team,
    I am trying to move the .pdf files from drop-off library to custom library.
    For the above requirement i am writing content organizer rule condition like (On Group: Document content types & Type: Document)
    Property: Name
    Operator: Ends with
    value: .pdf
    and Setting value in target location like
    /sites/MS/ProductGuides
    How to solve the issue
    If help appriciated
    Regards,
    Dhaya

    Hi Dhaya,
    I created a Content Organizer rule like this:
    When uploading a .pdf file to the Drop Off library, it is moved to the destination library immediately:
    I suggest you create a similar rule as above for another test to see if the issue still persists.
    Thanks 
    Patrick Liang
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to create a document library in Sharepoint Online using Powerpoint?

    I've been trying to create a document library in Sharepoint Online via pwoershell and I've been trying to see if anyone else has the code but the only scripts i could find are for Sharepoint 2010 on-premise and it's not compatible with Sharepoint 2013.
     Can anyone help me?
    Thanks!
    Dearbhla Bradley

    It's SharePoint Client-side Object Model.  Here are few references:
    http://msdn.microsoft.com/en-us/library/office/jj193041(v=office.15).aspx
    http://msdn.microsoft.com/en-us/library/office/dn268594(v=office.15).aspx
    These postings are provided "AS IS" with no warranties, and confers no rights.

  • Third party tool for document preview in sharepoint 2013

    Hello,
    we are looking for third party tool which provide preview of any documents in documnet library in sharepoint 2013. So when users just hover over the document, they can see the preview. Do
    any of you please provide a good suggetion in case if you have used in the past? In my research I came across
    Knowledgelake and harepoint. Also I think there is one Metalogix but I know for sure it a way too costly. So please help if you know who does this job with a fair amount of price.
    Thanks.

    I've found Ontolica Preview to be adequate for this. Reasonable product and supports a lot of formats
    http://www.sharepointreviews.com/component/content/article/69-sharepoint-auditing/202-Ontolica-BehaviorTracking-for-SPS-2003-.pdf
    Might also be worth spending some time on SharePointreviews.com for other suggestions
    http://www.sharepointreviews.com/
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • How to sync only subfolders in a library in SharePoint 2013?

    Hi, I have one library in which too many folders and subfolders are created.<o:p></o:p>
    I want to sync only 2 subfolder to my PC from SharePoint 2013 site.<o:p></o:p>
    Is it possible to sync only subfolder instead sync complete library? <o:p></o:p>

    Hi,
    According to your post, my understanding is that you wanted to sync only subfolders in a library in SharePoint 2013.
    Using SkyDrive Pro you can only sync at document library level. You cannot sync complete site or a single folder in a document library.
    With SkyDrive Pro Sync Client, there is no possibility to Sync a partial subset of a document library. By design the entire doc library gets synced and we get local copies of all the files and folders under it.
    When a User attempts to sync a sub folder within a Library, the sync tool always picks the parent Library as the Sync point and syncs everything under it. Users are forced to sync the document library as a whole.
    More information:
    SkyDrive Pro Demystified!
    http://blog.technovert.com/2013/11/skydrive-pro-demystified/#more-143
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Document Preview in SharePoint 2013 without office webapps

    Hi,
    A friend of mine was asking if there is an option OOB or any third party which would provide the option to preview the document in the document library without Office webapps, (His client has SharePoint 2013)
    Any suggestions are appreciated....!
    Satyam...

    The same question posted here - go through the thread 
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/38794517-2eeb-46df-b781-77e634c69b1b/third-party-tool-for-document-preview-in-sharepoint-2013?forum=sharepointadmin#a0310766-399b-4f66-a762-e6394b1770e0
    Regards,
    Pratik Vyas | SharePoint Consultant |
    http://sharepointpratik.blogspot.com
    Posting is provided AS IS with no warranties, and confers no rights
    Please remember to click Mark As Answer if a post solves your problem or
    Vote As Helpful if it was useful.

  • Prompting the credentials while click MS office documents in document library in SharePoint Foundation 2010

    Hi,
    I have site with contains many document library each contains many MS Office and Pdf files. We have provided document library level access rights. While users click the file name, "Prompting the credentials while click MS office documents in document
    library in SharePoint Foundation 2010".
    Its annoying the user.
    How could i resolve this? Its for all users.
    Note: only for MS Office file. other files are opening correctly.
    Kind Regards
    Poomani Sankaran

    Hi,
    According to your post, my understanding is that you got the promote issue when clicked the documents in the library of the SharePoint foundation server.
    The issue may be caused that the Kerberos authentication is misconfigured, you can change to NTLM to check whether it works.
    http://www.techrepublic.com/blog/smb-technologist/prevent-unwanted-credentials-prompts-with-sharepoint-document-libraries/
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Creating a folder for a document library in SharePoint online

    Hello I am looking for a good place to get started on creating a folder for a document library using a powershell script. Thanks in advance for any help.

    Here is a guide to creating folders and items in a document library for SharePoint Server/Foundation: Creating SharePoint Folders
    and Items with PowerShell. You will need to tailor it to your needs as it's a demo for creating 50,000 items.
    That's step 1 and contains the bulk of what you would need to do. Here's an example of connecting to a library in SharePoint Online using CSOM: Office
    365 - PowerShell Script to Upload Files to a Document Library using CSOM. You won't be uploading files, but the parts where you connect and get a list are what you're interested in.
    Now you'll combine bits from both of these scripts:
    1. Connect to SPO
    2. Get your list (looks like you need to first get the site collection and then the site)
    3. Create a folder
    I figure it would look something like this (note I haven't tested this at all):
    #Specify tenant admin and site URL
    $User = "[email protected]"
    $SiteURL = "https://tenant.sharepoint.com/sites/site"
    $DocLibName = "DocLib"$FolderTitle = "Example Folder"
    #Add references to SharePoint client assemblies and authenticate to Office 365 site - required for CSOM
    Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
    Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
    $Password = Read-Host -Prompt "Please enter your password" -AsSecureString
    #Bind to site collection
    $Context = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
    $Creds = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($User,$Password)
    $Context.Credentials = $Creds
    #Retrieve list
    $List = $Context.Web.Lists.GetByTitle($DocLibName)
    $folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder)
    $folder["Title"] = $FolderTitle
    $folder.Update();
    Jason Warren
    @jaspnwarren
    jasonwarren.ca
    habaneroconsulting.com/Insights

  • How to create a Document Set in SharePoint 2013 using JavaScript Client Side Object Model (JSOM)?

    Hi,
    The requirement is to create ""Document Sets in Bulk" using JSOM. I am using the following posts:-
    http://blogs.msdn.com/b/mittals/archive/2013/04/03/how-to-create-a-document-set-in-sharepoint-2013-using-javascript-client-side-object-model-jsom.aspx
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/1904cddb-850c-4425-8205-998bfaad07d7/create-document-set-using-ecma-script
    But, when I am executing the code, I am getting error "Cannot read property 'DocumentSet' of undefined "..Please find
    below my code. I am using Content editor web part and attached my JS file with that :-
    <div>
    <label>Enter the DocumentSet Name <input type="text" id="txtGetDocumentSetName" name="DocumentSetname"/> </label> </br>
    <input type="button" id="btncreate" name="bcreateDocumentSet" value="Create Document Set" onclick="javascript:CreateDocumentSet()"/>
    </div>
    <script type="text/javascript" src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js"> </script>
    <script type="text/javascript">
       SP.SOD.executeFunc('sp.js','SP.ClientContext','SP.DocumentSet','SP.DocumentManagement.js',CreateDocumentSet);
    // This function is called on click of the “Create Document Set” button. 
    var ctx;
    var parentFolder;
    var newDocSetName;
    var docsetContentType;
    function CreateDocumentSet() {
        alert("In ClientContext");
        var ctx = SP.ClientContext.get_current(); 
        newDocSetName = $('#txtGetDocumentSetName').val(); 
        var docSetContentTypeID = "0x0120D520";
        alert("docSetContentTypeID:=" + docSetContentTypeID);
        var web = ctx.get_web(); 
        var list = web.get_lists().getByTitle('Current Documents'); 
        ctx.load(list);
        alert("List Loaded !!");
        parentFolder = list.get_rootFolder(); 
        ctx.load(parentFolder);
        docsetContentType = web.get_contentTypes().getById(docSetContentTypeID); 
        ctx.load(docsetContentType);
        alert("docsetContentType Loaded !!");
        ctx.executeQueryAsync(onRequestSuccess, onRequestFail);
    function onRequestSuccess() {       
        alert("In Success");
        SP.DocumentSet.DocumentSet.create(ctx, parentFolder, newDocSetName, docsetContentType.get_id());
        alert('Document Set creation successful');
    // This function runs if the executeQueryAsync call fails.
    function onRequestFail(sender, args) {
        alert("Document Set creation failed" + + args.get_message());
    Please help !!
    Vipul Jain

    Hello,
    I have already tried your solution, however in that case I get the error - "UncaughtSys.ArgumentNullException: Sys.ArgumentNullException:
    Value cannot be null.Parameter name: context"...
    Also, I tried removing SP.SOD.executeFunc
    from my code, but no success :(
    Kindly suggest !!!
    Vipul Jain

  • Updating a title column in list that is a lookup column to document library in sharepoint designer workflow 2010

    Hi I have a requirement to create a list item in Contracts List when a document is uploaded in Contracts Vendor library.
    Contracts List will
    have  columns - Contract Name ( title column), Contract Number, Contract Start date and end date.
    Contracts Vendor library will have Contract
    Name,Contract NUmber.
    User will select the Contract Name from drop down ( this is look up column linked to Contract Name in Contract
    List).When user uploads document in Contract Vendor library then item should be created in Contract List with selected Contract Name and
    Contract number .
    Contracts and Contracts Vendor are related by look up Contract Name. Contract Name is internally a title column in
    Contracts List.
    Issue1 :
    Since Contract number is look up column, while I am creating item the Contract name is not getting updated in
    Contracts List. I have to use sharepoint designer workflow to achieve this task. Title colum or Contract Name shows no title.
    Issue 2:
    One
    more issue I am facing is that Contracts List has Section and Division cascaded drop downs when i select values from section and division
    dropdowns and save item in Contracts list the values are getting saved in Contract List.
    Could anyone suggest me how to handle this ? I am
    attaching the screenshots of the list and library structure. TRuly appreciate your help.
    Below are screenshots of the list structure

    Hi,
    According to your post, my understanding is that you wanted to update a title column in list that is a lookup column to document library in sharepoint designer workflow 2010.
    I try to reproduce the issues as follows:
    Create a custom list named Contracts List, add columns: Contract Name ( title column), Contract Number(Number), Contract Start date(Data and Time) and Contract End date (Data and Time).
    Create a document library named Contracts Vendor library, add columns: Contract Name(Lookup), Contract NUmber(Lookup).
    Create a workflow associated to the Contracts Vendor library.
    Add action: Create List Item.
       5. Start the workflow automatically when an item is created.
       6. Upload a document, select the Contract Name and Contract NUmber, the workflow will be started automatically.
       7. Open the Contracts List, an item will be added with the Contract Name and Contract Number in the Contracts Vendor library.
    Thank you for your understanding.
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

Maybe you are looking for