Update Sharepoint 2013 document library folder columns using document url

Hi All,
I have a SharePoint document library. In that library I am having folder name called Folder1. In this folder Folder1 I have 4 files in it. Now. I need to update the status column of these 4 files in Folder1 folder using the url of these 4 files.
So can anyone help me in to solve this problem. I am using SharePoint 2013 and Visual studio 2012. I want the code in C#.
Thanks & Regards,
Kishore
Kishore

Hi,
According to your post, my understanding is that you want to update the field within the folder.
I have made a simple code demo below to update the field within the folder, you can have a look at it.
using (SPSite site = new SPSite("http://YourSiteURL"))
using (SPWeb web = site.OpenWeb())
SPList list = web.Lists.TryGetList("Lib1");
if (list != null)
foreach (SPListItem folderItem in list.Folders)
if (folderItem.Title == "Folder1")
SPListItem item = list.GetItemById(5);
item["Status"] = "Updated";
item.Update();
Console.WriteLine("Field update successfully...");
Thanks & Regards,
Jason
Jason Guo
TechNet Community Support

Similar Messages

  • Unable to see existing documents in a Custom Sharepoint 2013 Document library while saving a document directly in it using explorer mode

    Hi,
    We have a SharePoint 2013 doc library based on a custom template, which has been migrated from 2010.
    We are unable to see existing documents in a Document library created using this template while saving a document directly in it using explorer mode, However we can save files and even see them in explorer mode, only when we try to save a new document there
    directly, we cant see the old docs.
    All the OOB libraries work fine.
    Below is the normal behavior while saving a file, however nothing comes up when saving on this custom template library

    Solved it myself guys... (Well the major part)
    Got help from here...
    https://www.nothingbutsharepoint.com/sites/devwiki/articles/pages/blank-open-save-dialog-when-browsing-document-library-from-office-clients.aspx
    and
    http://www.sharepointconfig.com/2011/02/vs2010-list-definition-template-missing-file-dialog-view/
    with some tweaks of my own..
    Still working on it because its showing SharePoint 2010 header... And I need 2013 look...

  • How to Insert Sharepoint 2013 Person or Group Field using VBA

    Hello,
    How to Insert Sharepoint 2013 Person or Group Field using VBA , I tried set the field with ID / ID;Name / Name
    but all failed, Please advice 
    Function SetSP_Field(F_Yer As Single, F_WekNo As Single, F_ProjectNum As String, strField As Variant, strFieldValue As Variant) As String
    ' test code
        Dim rst         As Recordset
        Dim strSQL      As String
        Dim SP_RecSet   As ADODB.Recordset
        Set SP_RecSet = New ADODB.Recordset
        SetSP_Field = False
        strSQL = "Status Report"
        On Error Resume Next
        Call SP_Connect(2)
        strSQL = "select " & SP_List & ".* From  " & SP_List _
               & " Where [Year] = " & CInt(F_Yer) _
               & "   and [WeekNo] = " & CInt(F_WekNo) _
               & "   and [Compass_Code] = '" & F_ProjectNum & "' ; " _
    '           & " Set " & strField & " = " & strFieldValue
        'Debug.Print strSQL
        'Debug.Print SP_CN
        SP_RecSet.Open strSQL, SP_CN, adOpenStatic, adLockOptimistic
        If SP_RecSet.RecordCount = 0 Then
            Debug.Print "Record for project: " & F_ProjectNum & " not found"
            LogFile.WriteLine ("Record " & strID & " not found")
        End If
        If Not SP_RecSet.EOF Then
            'SP_RecSet.Edit
            SP_RecSet.Fields(strField) = strFieldValue
            SP_RecSet.Update
            If Err.Number <> 0 Then
                MsgBox ("SP Update Error: " & Err.Description)
                GoTo Exit_Fun
            End If
            SetSP_Field = True
        End If
    Exit_Fun:
        SP_RecSet.Close
        Set SP_RecSet = Nothing
    End Function

    Hi Tim,
    Let’s verify the followings:
    Whether this issue occurred for other lists in the same site.
    Whether this issue occurred for all users who don’t have full control.
    Whether this issue occurred on other sites.
    When you created the people & group column, which show field did you used? Please try to use a different show field for the people & group column, compare the result.
    In addition, please check if the link is useful:
    http://www.learningsharepoint.com/2013/08/21/empty-value-in-people-picker-after-saving-the-list-form-in-sharepoint/
    Best Regards,
    Wendy
    Wendy Li
    TechNet Community Support

  • I created a Pages document inserting 2 columns using 1) Inspector 2) Layout 3) columns.  How do I decrease the height of the column.  Have tried to use cursor and drag down the top border, but that does not reset the top border.

    I created a Pages document inserting 2 columns using 1) Inspector 2) Layout 3) columns.  How do I decrease the height of the column.  Have tried to use the cursor and drag down the top border, but that does not reset/decrease the top border.

    Set your columns back to one for the moment. In layout mode, insert a Text box. Place it in the upper left corner of your document, and drag down and right to the size of the container for your two columns. Click inside the Text Box, and now bump up your columns to 2. Your two columns are now contained in this resizable Text Box.

  • Displaying Document Name With The Summary in a Single Column Using Document Library View.

    Hi All,
    I have a question that relates to SharePoint Document Library Views. I want to view the Documents name with the summary in a single column. Below image shows an example of it. I need this within a SharePoint Document Library. Also I want the height of the
    row to be increased more than the default height. I cannot figure it out how to do that? Could you someone help me to do this. I have inserted the Document Library as an App Part to the page. 
    So could you someone help me to solve this matter?
    Thanks and regards,
    Chiranthaka

    HI Chiranthaka,
    You can create DataView webpart using SPD and then modify the display template according to your need.
    http://deannaschneider.wordpress.com/2012/07/10/item-counts-dvwp-sp2010/
    Hope this will help to solve your problem.
    Best Regards,
    Brij K

  • Displaying Document Name & The Summary in a Single Column Using Document Library View

    Hi All,
    I have a question that relates to SharePoint Document Library Views. I want to view the Documents name with the summary in a single column. Below image shows an example of it. I need this within a SharePoint Document Library. Also I want the height of the row
    to be increased more than the default height. I cannot figure it out how to do that? Could you someone help me to do this. I have inserted the Document Library as an App Part to the page. 
    So could you someone help me to solve this matter?
    Thanks and regards,
    Chiranthaka

    HI Chiranthaka,
    You can create DataView webpart using SPD and then modify the display template according to your need.
    http://deannaschneider.wordpress.com/2012/07/10/item-counts-dvwp-sp2010/
    Hope this will help to solve your problem.
    Best Regards,
    Brij K

  • How to get Custom-Content-type Column Value of a Document Library-Folder

    Hello
    I have to add a custom-column(folder-imageURL) for Folders in a Document Library.
    So I have created a Custom-CotentType "FolderCtype" with new column "folder-imageURL" and attached in the Document Library.
    Whenever I create a new folder in that document library I will select my "FolderCtype" & and then add an image url in "folder-imageURL" column.
    How do I access this image url in Code?
    part of my code is as follows.
    SPContentType cntType = List.ContentTypes["FolderCtype"];
    SPField field = cntType.Fields.GetField("folder-imageURL");  //I have Field name here//
     foreach (SPFolder folder in RtFolder.SubFolders)
                        if (folder.Name.ToUpper() != "FORMS")
                           string FolderName = folder.Name;
                          string FolderImageUrl = ?              //How can I get this????//
    Thanks in advance

    Hi, Patrickm, Thank You
    If your “folder-imageURL” column is a “Hyperlink or Picture” column, then you can get the hyperlink like this:
    SPListItem item = folder.Item;
    if (item[field.Title] != null)
    string FolderImageUrl = item[field.Title].ToString().Split(',')[0];
    Console.WriteLine(FolderImageUrl);
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support
    S H A J A N

  • SharePont 2013 Document Library lookup Column Properties not Showing Correctly when editing in Word

    Hi
    I keep seeing this issue albeit intermittently.  I have set up a doc library for my users which has a custom content type (lookup, metadata columns, etc)  . They all appear perfectly most of the time except the lookup column. Sometimes is just
    decides to display the title field of the current library and not the lookup list title .  It is weird as it has been working perfectly for ages given the library is populated with valid documents.
    There are some fixes listed here. Has anyone got any experience of this?
    https://social.msdn.microsoft.com/Forums/azure/en-US/e0b55531-509c-4219-8113-61b3e488de69/document-library-metadata-properties-of-a-content-type-do-not-show-correctly-when-editing-in-word?forum=sharepointdevelopmentprevious
    Freelance consultant

    Hi,
    According to your post, my understanding is that the lookup  column not display well while editing in word.
    Did you customize the Document Information Panel?
    I recommend you edit your custom document information panel or create a new document information panel, then re-publish it to check whether it works.
    https://support.office.com/en-gb/article/Create-or-edit-a-custom-Document-Information-Panel-for-a-content-type-b701a9af-3ea6-4c1a-9e1c-75363bd987c9?ui=en-US&rs=en-GB&ad=GB
    Or you can also use the methods in the post you have pasted to check whether it works.
    As the limitation of the environment, we could not reproduce the issue in our environment.
    I  would suggest you open a case to Microsoft Customer Service via Phone.
    Thanks,
    Jason
    Forum Support
    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]
    Jason Guo
    TechNet Community Support

  • Using SharePoint 2013 OIP the "Title" column is not displayed

    Using the SharePoint 2013 OIP against our SharePoint 2013 environment, I am seeing that the "Title" column is never displayed in any of the activities or published data.  This is the only limitation that is preventing me from using this OIP.
     Currently using the scorch OIP and am concerned that it seems is not being actively maintained.  Which by the way shows the Title column in all the same lists I am connecting to with the Microsoft provided OIP.
    Thanks for any guidance you can provide,
    Jim

    Hi Jim, this is something I've seen before. It may be a bug in the SharePoint 2013 IP, though it does work in some cases and not in others, so difficult to say what the cause is. My recommendation is to change your list to make the default Title column optional
    and hidden, and use a new custom field for the name of the item instead. See also:
    http://sharepoint.stackexchange.com/questions/118181/how-to-remove-title-column-in-sharepoint-2013-list
    Noah Stahl | Automys |
    Downloadable Microsoft automation examples and solutions

  • MMS Hidden columns appearing in Document Library Settings / Column list

    Hello all,
    Before you read this please be aware that I have found a resolution (that might be helpful to others) but I am wondering if anyone else has experienced the same thing and the cause.
    Our scenario is as follows:
    We use a Content Type hub
    Most Content Types include one or more Managed metadata columns
    The MMS Notes (hidden) columns (e.g. mms_column_name_0) have appeared on the 'Document Library Settings page under 'Columns' for 2 document libraries only. They appear under the actual name of the column (e.g. mms_column_name).
    They are NOT visible to the user however (i.e. they are not selectable to be used in a view)
    Looking at SharePoint Manager the mms Notes column's are marked as being Hidden = false. Altering this to true has the desired effect.
    But has anyone else experienced the same issue as I'm inquisitive as to the cause.
    The only thing I can think of that caused this to happen was us using 'Metadata navigation settings' (which allows you to configure navigation hierarchies) for the first time on one of the 2 Doc Libs effected . However, on testing it on other document
    libraries the unhiding of columns has not occurred.
    Can anyone shed any why this may have occurred?
    Jason

    Hi jasonl27,
    this behaviour:
    This is by design. Two separate lists do not have any type of relationship established to distinguish that the
    columns are the same. For example, take an arbitrary column called "Position" being created on two different custom lists. Because the column Position is a custom column created
    in the list, it has no mapping to other lists. The "Position"
    in one list could refer to a title of a person
    in one list, or a physical location on a different list. SharePoint cannot tell if these two items are the same or completely different. As a result, a new column name is added when we move the item.
    perhaps you may try to do these steps:
    $site = Get-SPSite -Identity "http://......../"
    $web = $site.RootWeb
    $field=$web.Fields["column name"]
    $field.Update($true)
    $field.Hidden= "True"
    $web.Dispose()
    $site.Dispose()
    Regards,
    Aries
    Microsoft Online Community Support
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Cannot a file to document library with column validation

    I have two problems
    Problem#1: I can not create a file from C# code, If document library has a text column with Sharepoint column validation.
    SharePoint throws exception if I invoke SPFileCollection.Add method.
    at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx) at Microsoft.SharePoint.Library.SPRequest.PutFile(String bstrUrl, String bstrWebRelativeUrl, Object punkFile, Int32 cbFile, Object punkFFM, PutFileOpt PutFileOpt, String
    bstrCreatedBy, String bstrModifiedBy, Int32 iCreatedByID, Int32 iModifiedByID, Object varTimeCreated, Object varTimeLastModified, Object varProperties, String bstrCheckinComment, Byte partitionToCheck, Int64 fragmentIdToCheck, String bstrCsvPartitionsToDelete,
    String bstrLockIdMatch, String bstEtagToMatch, Int32 lockType, String lockId, Int32 minutes, Int32 fRefreshLock, Int32 bValidateReqFields, Guid gNewDocId, UInt32& pdwVirusCheckStatus, String& pVirusCheckMessage, String& pEtagReturn, Byte& piLevel,
    Int32& pbIgnoredReqProps) at Microsoft.SharePoint.SPFileCollection.AddStreamOrBytesInternal(String urlOfFile, Stream file, PutFileOpt fileOpt, String createdBy, String modifiedBy, Int32 createdByID, Int32 modifiedByID, DateTime timeCreated, DateTime timeLastModified,
    Object varProperties, String checkInComment, Stream formatMetadata, String lockIdMatch, String etagToMatch, SPLockType lockType, String lockId, TimeSpan lockTimeout, Boolean validateRequiredFields, SPVirusCheckStatus& virusCheckStatus, String& virusCheckMessage,
    String& etagNew, Boolean& ignoredRequiredProps) at Microsoft.SharePoint.SPFileCollection.Add(String urlOfFile, Byte[] file, SPFileCollectionAddParameters parameters)
    If I remove column validation, I don't get that error.
    It would appear that the error is thrown internally in Sharepoint's Add API.
    Not quite sure how to proceed now.
    Problem#2: Even if I input a valid value in the column validation, the same error above is still thrown.
    Confused................
    [Update] Okay, I have found the reason for the exception (correct if I am wrong). Sharepoint File has metadata, and when I do the Add function, Sharepoint internally does a validation on the metadata and it will throw exception if not validated. That's why
    validation would fail even when I am inputting some valid data in my field (because I am not sending that valid data to the Add function through metadata properties).So, my question now is:
    Is it possible to prevent the validation on the metadata properties? Is there some APi for it?

    I was probably not clear in my thread.
    What I would want is for my code to upload the file to the server and then allow me to input my values for the metadata, THEN do the validation. Similar to how you upload a document to sharepoint library using the out-of-the-box webparts.
    But, right now in my code, this is not possible. Uploading the file using the Add API will just throw an error BEFORE even allowing me to input any values for my item/file metadata. So, I am trying to find a way to upload my file without the validation (pretty
    much like how microsoft does it in oob)
    Not sure if this is clear enough now

  • Items greyed out after upgrading and migrating to Sharepoint 2013 - Open and Check Out + Manage Document Option

    Hi there,
    Following a migration to SharePoint 2013, the follow options have been disabled (Open and Check out + Manage) (see below). These are critically important functions and make it very hard to make SharePoint a useable interface. Any guidance on how to resolve
    these issues is greatly appreciated. This is not a branded website, and there has been no changes made to the standard interface.
    Kind regards
    Jarrad Koppen

    I'm not sure what the easiest way is either.  First, I would try to create a new site collection with a new library and see if you get the same behavior.  If not, then its something in the upgrade process.  If it does that also would point
    to something being wrong in the way that javascript is being executed.
    If it is happening everywhere I suspect you'll have to start tracing javascript using something like IE developer's toolbar to see why the status on those buttons isn't changing when you select a document.  I'm not sure what else to suggest.
    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.

  • Sharepoint 2013 Does not open files using UNC path from Server

    Hi All,
    Just setup our new 2013 sharepoint intranet site , I tried adding a hyperlink to a document stored on our server using a UNC path file://servername/share/filename.doc but when i click on it it takes me to a blank Webpage in a new tab.
    I have turned on "open client applications" in the site collection features hoping that would help ....buuuuuut it did not.
    Also tried variations in the UNC path eg: \\servername\share\filename.doc etc..
    Any help would be greatly appreciated
    Thanks

    Open start run > type > file://servername/share/filename.doc Does this works
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/63b229de-ce4a-42be-b209-2c0f33d4b0d5/problem-opening-an-access-file-from-a-unc-file-link-in-sharepoint?forum=sharepointgeneralprevious
    Actually the problem I described is an Internet Explorer issue and I will try to get resolution in the appropriate forum.  IE exhibits the described behavior whether the link is in a Sharepoint site page, or in a regular non-Sharepoint web page. 
    Mozilla does not have the issue.
    Check below:
    http://social.msdn.microsoft.com/Forums/en-US/3f2c34cc-5686-4e03-ba26-092aaa29ff33/link-from-document-library-to-unc-path
    If this helped you resolve your issue, please mark it Answered

  • Power Pivot Configuration error while refreshing connection on excel sheet for SharePoint 2013 and Sql server 2014 using BISM file connection

    I am getting following error while refreshing connection on excel sheet in power pivot gallery,
    my scenario,
    using BISM file connection to create and  refresh power pivot excel sheet in power pivot gallery
    throws error and we have sql server 2014 CU6 updated installed plus sharepoint 2013. i checked following msolap110.dll is available in our environment but assembly
    Microsoft.AnalysisServices.ChannelTransport is not available. 
    i found error in event viewer,
    "Activation context generation failed for "C:\Program Files\Microsoft Analysis
    Services\AS OLEDB\110\msolap110.dll". Dependent Assembly
    Microsoft.AnalysisServices.ChannelTransport,processorArchitecture="MSIL",publicKeyToken="89845dcd8080cc91",version="11.0.0.0" could
    not be found. Please use sxstrace.exe for detailed diagnosis.
    what should i do to fix it?
    Thanks for help.
    Deepak Patel

    Rebecca,
    yes, this is issue i am getting.
    Activation
    context generation failed for "C:\Program
    Files\Microsoft Analysis Services\AS OLEDB\110\msolap110.dll".
    Dependent AssemblyMicrosoft.AnalysisServices.ChannelTransport,processorArchitecture="MSIL",publicKeyToken="89845dcd8080cc91",version="11.0.0.0" could
    not be found. Please use sxstrace.exe for detailed diagnosis.
    let me know if you can find fix for it.
    THanks,

  • Detect what the default edit form is for a document library and list using jquery

    Hi,
    So what I have done is with some jquery made it that when a files are dragged and dropped into a document library and there is a required field such as "Metadata" the EditForm.aspx opens up for the user to fill in the required column. I am building
    the url up from what I have found in SharePoints DragDrop.js file. This is all working perfectly I just need to find a way to dynamically find what the default edit form is for that document library as I have just hardcoded like this...
    g_currentControl.strSiteUrl + "/" + this.ListName + "/Forms/EditForm.aspx?ID=" + id
    So I need a way to figure out what the default edit form is instead of hard coding like this in case someone creates a custom_editform.aspx or something for one of the lists.
    Thanks

    You can get it by hitting this REST end point via JQuery:
    http://weburl/_api/Web/Lists(guid'YOURLISTGUID')/Forms
    Chris Givens CEO, Architecting Connected Systems
    Blog Twitter

Maybe you are looking for

  • Error saving connection - jdev

    Hi , I am strying to create a Webservice Data control from a wsdl generated from a SOA process deployed in the server and when I click on the finish button during the configuration in Jdev - It gives null pointer exception - Error saving connection.

  • How can you delete part of a message not the whole  conversation?

    How do you delete part of a message from a conversation on the new upgrade? You used to be able to click on the text, ticking it and then hit trash but thats gone. Please help!!

  • How to access dialing lists in UCCX 8.0?

    Hello Pros This is our first UCCX live environment and among the issues we have faced is the fact that we haven't found a way to "easily" (that means not through pure SQL queries) access the dialing lists from the Outbound Preview Dialer once they ha

  • Windows 8.1 Audio Stuttering

    Since upgrading to 8.1 my computer's audio has been stuttering. For instance whenever I play music either on windows media player or on youtube etc, when doing an activity while its playing, the audio stutters. Heres my specs:  Motherboard: Asus P8Z6

  • Reminders on 3GS not working?

    When I open reminders application on my iphone 3gs, there is no + button on the top right screen and not able to add a reminder. Please help.