Add datetime property to "MetaInfo" field using SharePoint 2013 CSOM

When uploading a file along with metadata using SharePoint FP RPC (using the "method= put document") it allows me to properly add datetime properties. My metainfo looks like this:
"MetaInfo":"...MyCustomDate:TW|05 Jan 2015 12:58:31 -0000\r\n..."
Then later on, when I try to update "MyCustomDate" property from the "MetaInfo" field using CSOM, it fails while updating it. (In this case I am using CSOM because I am updating some more fields and I want to avoid extra round-trips)
After that update my metainfo looks like this:
"MetaInfo":"...MyCustomDate:FX|0x01d028e7|0x4d1c4880\r\n..."
Does anyone know why?, is there any workaround?
Thanks

Hi,
If you want to add datetime property to "MetaInfo" field using SharePoint 2013 CSOM, the following code snippet for your reference:
using (ClientContext context = new ClientContext("http://yourserver/"))
context.Credentials = new NetworkCredential("user", "password", "domain");
List list = context.Web.Lists.GetByTitle("Documents");
ListItem oListItem = list.GetItemById(1);
oListItem["MetaInfo"] = "MyCustomDate:TW|08 Jan 2015 12:58:31 -0000";
oListItem.Update();
context.ExecuteQuery();
Best Regards
Dennis Guo
TechNet Community Support

Similar Messages

  • Issue in mapping custom user profile property with AD field in SharePoint 2013

    Hello,
    I am trying to map a custom user profile property i created "ADSecurityGroups", type - String, Multivalue with the AD propoerty named "memberOf" via powershell.
    UserProfile Service is up and running, and so is the Synchronization Service. User executing the powershell has full control on the User Profile Service and is the farm administrator.
    Following is the code snippet i grabbed from the internet which i am trying to execute.
    Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction "SilentlyContinue" 
    $url = "http://<servername:port>/" #URL of any site collection that is associated to the user profile service application. 
    $spsProperty = "ADSecurityGroups" #Internal name of the SharePoint user profile property 
    $fimProperty = "memberOf" #Name of the attribute in FIM/LDAP source 
    $connectionName = "UserProfileSyncConnection" #Name of the SharePoint synchronization connection
    $site = Get-SPSite $url
    if ($site) 
        Write-Host "Successfully obtained site reference!"
    else 
        Write-Host "Failed to obtain site reference"
    $serviceContext = Get-SPServiceContext($site)
    if ($serviceContext) 
        Write-Host "Successfully obtained service context!"
    else 
        Write-Host "Failed to obtain service context"
    $upManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileConfigManager($serviceContext)
    if ($upManager) 
        Write-Host "Successfully obtained user profile manager!"
    else 
        Write-Host "Failed to obtain user profile manager"
    $synchConnection = $upManager.ConnectionManager[$connectionName]
    if ($synchConnection) 
        Write-Host "Successfully obtained synchronization connection!"
    else 
        Write-Host "Failed to obtain user synchronization connection!"
    Write-Host "Adding the attribute mapping..." 
    $synchConnection.PropertyMapping.AddNewMapping([Microsoft.Office.Server.UserProfiles.ProfileType]::User, $spsProperty, $fimProperty) 
    Write-Host "Done!"
    The script is failing with the following error - 
    new-object : Exception calling ".ctor" with "1" argument(s): "UserProfileApplicationNotAvailableException_Logging :: 
    UserProfileApplicationProxy.ApplicationProperties ProfilePropertyCache does not have 2f9bece3-f39a-498d-874f-145b1470e49c"
    At E:\ADSync.ps1:29 char:14
    + $upManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileConfigMa ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [New-Object], MethodInvocationException
        + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand
    Please let me know if i am missing anything.
    Also advise if this is the correct way to map user profile attribute in SP 2013 ?
    Thanks -
    Girish

    ok no worry,
    try to run the below as it is, i m just copying code from your post.
    Add-PSSnapin Microsoft.Sharepoint.Powershell
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server")
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server.UserProfiles")
    #Function to get servicecontextfunction Get-SPServiceContext([Microsoft.SharePoint.Administration.SPServiceApplication]
    $profileApp)
    $profileApp = @(Get-SPServiceApplication | ?
    {$_.TypeName -eq "MR_DEV_UserProfileServiceApplication"})[0]
    return [Microsoft.SharePoint.SPServiceContext]::GetContext
    ($profileApp.ServiceApplicationProxyGroup,
    [Microsoft.SharePoint.SPSiteSubscriptionIdentifier]::Default)
    $url = "http://sp-appdev:2013" #URL of any site collection that is associated to the user profile service application.
    $spsProperty = "RoomNumber" #Internal name of the SharePoint user profile property
    $fimProperty = "extensionAttribute2" #Name of the attribute in FIM/LDAP source
    $connectionName = "LDAP Sync" #Name of the SharePoint synchronization connection
    #Get UserProfileManager
    $serviceContext = Get-SPServiceContext
    if ($serviceContext)
    {Write-Host "Successfully obtained service context!"}
    else
    {Write-Host "Failed to obtain service context"}
    $upManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileConfigManager($serviceContext)
    if ($upManager)
    {Write-Host "Successfully obtained user profile manager!"}
    else
    {Write-Host "Failed to obtain user profile manager"}
    $synchConnection = $upManager.ConnectionManager[$connectionName]
    if ($synchConnection)
    {Write-Host "Successfully obtained synchronization connection!"}
    else
    {Write-Host "Failed to obtain user synchronization connection!"}
    Write-Host "Adding the attribute mapping..."
    $synchConnection.PropertyMapping.AddNewMapping([Microsoft.Office.Server.UserProfiles.ProfileType]::User, $spsProperty, $fimProperty)
    Write-Host "Done!"
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • Customize Approval Form to add custom fields using SharePoint Designer

    Hi,
    i have a created a Custom approval workflow using SharePoint Designer 2010. This is two steps approval WF, All i did put the variable "CancelonRejection" Value "Yes" and one Approval action with 2 different users as Serial. Right now
    Status, Requested by, Consolidated comments and comment fields are available on the approval form. Now i want to add some fields with radio buttons on Approval Form, so that 1st approver can select those radio/check box. Once 1st approver will approved this
    then display all the values on 2nd approver approval from or send email to 2nd approver along with all the information from 1st approver.
    Thanks in advanced!

    Hi,
    According to your post, my understanding is that you wanted to customize Approval Form to add custom fields using SharePoint Designer.
    In the SharePoint Designer, you can customize the task form.
    Here is a great article for your reference:
    Creating Custom Workflow Task Approval Forms with SharePoint Designer 2010
    However, every task can only have one task form.
    That is to say, the two approvors will have the same task form.
    As a workaround, I recommend to customzie the task form using InfoPath.
    You can create different view for the approvors.
    You need to add form load rules to swich views based on the approvors.
    More information:
    Using Multiple Views in Customized List Forms
    Add, delete, and switch views (pages) in a form - InfoPath
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • How to send emails to Multiple Users from a Single People Picker lookup field using Sharepoint designer workflow

    Hi All,
    I am working with SharePoint 2013 designer workflow. we are using office 365.
    Our requirement to send email to multiple users, get the user groups from lookup list people and groups column.
    But SP designer sending emails to the first user alone.
    Please guide me to proceed.
    Advance Thanks.
    Regards
    Jenkins NS
    Thanks and Regards Jenkins

    finally I got a solution
     Identified a workaround to solve the issue using SharePoint designer.
    Step 1
    Create a lookup list Example department
    Columns
    Title (by default) – Single line of text
    Users – Person or Group
    Emails – Multiple lines of text
    hidden the Emails column (go to content type and set the column as hidden)
    Create a SharePoint designer Workflow
    Start Workflow automatically when an item is created
    Also Start Workflow automatically when an item is changed
    Workflow Stage 1
    Set Emails to current Item: Users
    The workflow will get all users email ids and add in the Emails column delimiter as semicolon.
    Step 2
    Create a custom list to get the email ids and send email
    Create a lookup column ex: analysis and refer department list, Allow multiple values
    Then Create a SharePoint designer workflow
    full details workflow steps please follow below
    URL
    http://jenkinsblogs.com/2015/04/30/how-to-send-emails-to-multiple-users-from-lookup-list-people-picker-field-using-sharepoint-designer-workflow/
    Thanks and Regards Jenkins

  • Update Managed Metadata field in SharePoint 2013 Designer Workflow for O365

    Hi Guys,
    I need to update the managed metadata field in SharePoint Custom List using Workflow but its not working. I have also tried to use the HTTP WebService POST Operation but no luck.
    Am doing this for a SharePoint Online (O365) Site.
    Has anyone worked on something similar and was able to get it running ?
    I saw a post to create a custom Workflow Activity but I don't have a choice to go with the custom code option.
    http://patrickboom.wordpress.com/2013/07/23/workflow-activity-set-managed-metadata-column/
    I was able to achieve this by creating a SP 2010 based Workflow for O365. Which means that it worked well with SP 2010.
    Is there a different way to do it in 2013 ? I tried almost all options apart from creating custom Activity but nothing worked out. 
    Any help would be great.
    Thanks,
    Nutan
    Nutan Sharma

    Hi Nutan,
    According to your description, my understanding is that you want to update Managed Metadata field with SharePoint 2013 Designer for SharePoint Online.
    As far as I know, there is not an OOB action to achieve your requirement with SharePoint 2013 Designer for SharePoint 2013. Customizing a workflow action is a better option to achieve it.  Why didn’t you customize a workflow action as Patrick’s blog?
    In addition, please take a look at the article about Nintex workflow, check whether it is useful for you:
    http://habaneroconsulting.com/insights/setting-managed-metadata-fields-in-a-nintex-workflow#.UykBSf6KDHo
    As this issue is about SharePoint Online, I suggest you create a new thread on SharePoint Online forum:
    http://social.technet.microsoft.com/Forums/en-US/home?forum=onlineservicessharepoint . More experts will assist you.
    I hope this helps.
    Thanks,
    Wendy
    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]
    Wendy Li
    TechNet Community Support

  • Do we require to install microsoft excel in sharepoint 2013 server?. if require to use sharepoint 2013 excel services.

    Do we require to install microsoft excel in sharepoint 2013 server?. if require to use sharepoint 2013 excel services.
    In our organisation, development team is asking to install office 2013 in SharePoint 2013 server to use different services, where as architecture team not allowing for the same. I need to provide proper justification for installing office 2013 in SharePoint
    2013 server. Please provide me the correct solution for the same.

    No, you do not need to install Office on the SharePoint server to utilize the Excel Services. Office should not be installed on the SharePoint server.
    Do they need Office Web Apps? Are they looking to have the capability to edit documents in the browser maybe? Or have document preview on search? Office Web Apps would be required for this, but this is a different product than Office.
    Brandon Atkinson
    Blog: http://sharepointbrandon.com

  • Update Column value after current item is Approved and then publish major version using Sharepoint 2013 designer workflow

    Hi,
    We have a requirement to update a column value once the item has been approved.
    Following settings have been made in the publishing articles list:
    Require content approval for submitted items : yes
    Create major and minor (draft) versions
    Who should see draft items in this document library? :Only users who can edit items
    Require documents to be checked out before they can be edited? : yes
    I have createdatu a Sharepoint 2013 workflow to check if Approval sts of current item = 0 i.e. Approved , then check out and update the item and finally checkin the item. Everything works fine till this point except that the minor version of the item is
    checked in. Due to this the updated columns are not published to others.
    Also, I created a Sharepoint 2010 workflow to SET CONTENT APPROVAL = APPROVED and started this workflow from my list workflow above, but the item does not get checked-in and always shows "In Progress" status with comment "The item is currently
    locked for editing. Waiting for item to be checked in or for the lock to be released.".
    Please let me know where I am missing out so that once the item is approved, column value gets updated and current item is still in Approved status.
    Thanks

    Hi,
    According to your post, my understanding is that you want to update Column value after current item is Approved and then publish major version using Sharepoint 2013 designer workflow.
    You will get into this kind of Catch-22 situation trying to set the Content Approval Status in SharePoint Designer workflow:
    - You must check out the document before you can change the Content Approval Status
             - You can't change the Content Approval Status once the document in checked out
    Since you set the Require documents to be checked out before they can be edited=Yes, you will need to check out the document when run the workflow on the item. But you cannot approve a document when it is checked
    out. So the logic in workflow conflicts.
    As a workaround, you can use the Start Another Workflow action to start the normal Approval workflow on the document.  The built-in Approval workflow can work with a document that’s not checked out.
    The designer approval workflow also can work with a document that’s not checked out.
    You can create two workflow using SharePoint Designer 2013.
    First, create a SharePoint 2010 platform workflow.
    Then, create a SharePoint 2013 platform workflow.
    Then when the SharePoint 2013 platform workflow start, it will start the SharePoint 2010 platform workflow to set content approval status, then the SharePoint 2013 platform workflow will update current item value.
    More information:
    SharePoint Designer Workflow Content Approval Issue
    SharePoint 2010 Approval Workflow with Content Approval
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Using SharePoint (2013) groups in SSRS

    We had a report deployed in SharePoint 2007 that identified which SharePoint Group the user was in and used this in a parameter in the report. This used the method suggested in this question: http://social.technet.microsoft.com/Forums/sqlserver/en-US/c6ce0af7-2467-4ed8-8833-9bad438a28ad/how-to-get-sharepoint-group-in-ssrs?forum=sqlreportingservices
    Following an upgrade to SharePoint 2013, this no longer functions. The error refers to the specific dataset using the query suggested and returns a 'Soap Fault: The remote server returned an error: (500) Internal Server Error'.
    I would guess that I need to direct the <SoapAction> to look in another location, but I can't see any obvious location to look in.
    Suggestions for the correct location, or other solution, would be helpful.
    Thanks
    Ray

    Hi,
    According to your post, my understanding is that you wanted to use SharePoint 2013 hosted in Office 365 to power Portal Authentication-type experience.
    Per my knowleadge, configuring SSO helps you to enforce your organization's password policies and account restrictions in both your on-premises directory and your Office 365 directory.
    For more information, you can refer to:
    Overview of single sign-on for Office 365
    Step-By-Step: Setting up AD FS and Enabling Single Sign-On to Office 365
    Office 365 – Single Sign-On for SharePoint, Skydrive, CRM, etc. via Smart Links
    Regarding SharePoint Online, for quick and accurate answers to your questions, it is recommended that you initial a new thread in Office 365 forum.
    Office 365 forum
    http://community.office365.com/en-us/forums/default.aspx
    Thanks,
    Linda Li                
    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]
    Linda Li
    TechNet Community Support

  • Auto update people picker value with email id when we add username in another people picker field in sharepoint 2013 list using javascript

    hi friends
    i have to people picker fields
    pp1 and pp2
    pp1 represents username
    pp2 represents email id
    here i problem is if user enters name in pp1, pp2 has to update with email id of corresponding user in pp1 dynamically.
    using java script is there any solution for this.
    please help me

    Hope below will help
    <asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    <script type="text/ecmascript" language="ecmascript">
    var user;
    var visitorsGroup;
    function runCode() {
    var clientContext = new SP.ClientContext();
    var groupCollection = clientContext.get_web().get_siteGroups();
    // Get the visitors group, assuming its ID is 4.
    visitorsGroup = groupCollection.getById(4);
    user = clientContext.get_web().get_currentUser();
    var userCollection = visitorsGroup.get_users();
    userCollection.addUser(user);
    clientContext.load(user);
    clientContext.load(visitorsGroup);
    clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
    function onQuerySucceeded() {
    alert(user.get_title() + " added to group " + visitorsGroup.get_title());
    function onQueryFailed(sender, args) {
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    </script>
    <input id="Button1" type="button" value="Run Code" onclick="runCode()" />
    </asp:Content>http://msdn.microsoft.com/en-us/library/office/jj246835%28v=office.15%29.aspxhttp://msdn.microsoft.com/en-us/library/office/jj920104%28v=office.15%29.aspxhttp://stackoverflow.com/questions/20981226/sharepoint-2013-get-current-user-javascripthttp://sharepoint.stackexchange.com/questions/31457/get-user-via-javascript-client-object-model

  • How to custom Rating Scale field to add more range text in survey on sharepoint 2013

    When we use the rating scale field to create question in survey. You can only set three range texts for each question. Is there any way to allocate a range text for each range ? Such as below :
                                     Low             Average        High       Excellent      
    Important
                                     1                  2                  3    
              4                     5
    I put extra 1 Rating Text Value / Excellent . but it does not show at respond to survey page.
    <Field Type="GridChoice" DisplayName="rating4" Required="FALSE" EnforceUniqueValues="FALSE" Indexed="FALSE" GridStartNum="1" GridEndNum="5" GridTxtRng1="Low" GridTxtRng2="Average"
    GridTxtRng3="High" GridTxtRng4="Excellent" GridNATxt="N/A" ID="{5259c17a-9260-4857-8594-f7dc28281763}" SourceID="{2712de13-4857-4225-b5bd-06697c96ad5b}" StaticName="rating4" Name="rating4"
    ColName="ntext2" RowOrdinal="0"><CHOICES><CHOICE>q</CHOICE><CHOICE>g</CHOICE><CHOICE>h</CHOICE></CHOICES></Field>
    <Field Type="GridChoice" DisplayName="rating4" Required="FALSE" EnforceUniqueValues="FALSE" Indexed="FALSE" GridStartNum="1" GridEndNum="5" GridTxtRng1="Low" GridTxtRng2="Average"
    GridTxtRng3="High" GridTxtRng4="Excellent" GridNATxt="N/A" ID="{5259c17a-9260-4857-8594-f7dc28281763}" SourceID="{2712de13-4857-4225-b5bd-06697c96ad5b}" StaticName="rating4" Name="rating4"
    ColName="ntext2" RowOrdinal="0"><CHOICES><CHOICE>q</CHOICE><CHOICE>g</CHOICE><CHOICE>h</CHOICE></CHOICES></Field> 
    Thanks all your help !

    Hi,
    From Microsoft official site, we can find the definition of “Range Text”: enter descriptions for the low, middle, and high scale. It means there are only
    three types of description which is the by design behavior. For example, if we have 8 number range, the purpose of the range text is to tell users that 8 is highest and 1 is the lowest. We don’t need to specific description for each column.
    As you really want to achieve the goal, we can write client JavaScript code to dynamically update the UI on page. We use SharePoint designer updates the “NewForm.aspx”,
    “DispForm.aspx”, “EditForm.aspx” and “Summary.aspx” to add custom JavaScript codes.
    For NewForm.aspx; DispForm.aspx; EditForm.aspx
    <script type="text/javascript">
    var tables = document.getElementsByTagName('table');
    for (var i=0; i<tables.length; i++)
    if (tables[i].summary == 'Rating Scale Question')
    var trs = tables[i].getElementsByTagName('tr');
    var tds = trs[0].getElementsByTagName('td');
    tds[2].colSpan = 1;
    tds[2].innerHTML = 'your range text';
    tds[3].colSpan = 1;
    tds[3].innerHTML = your range text';
    tds[4].colSpan = 1;
    tds[4].innerHTML = your range text';
    tds[5].colSpan = 1;
    tds[5].innerHTML = your range text';
    </script>
    For Summary.aspx
    <script type="text/javascript">
    var tables = document.getElementsByTagName('table');
    for (var i=0; i<tables.length; i++)
    if (tables[i].className == 'ms-surveyVBarT')
    tables[i].deleteRow(0);
    var row = tables[i].insertRow(0);
    var cell0 = row.insertCell(0);
    var cell1 = row.insertCell(1);
    var cell2 = row.insertCell(2);
    var cell3 = row.insertCell(3);
    cell0.innerHTML = your range text';
    cell1.innerHTML = your range text';
    cell2.innerHTML = your range text';
    cell3.innerHTML = your range text';
    </script>
    These JavaScript codes are all added in the content tag which contentplaceholderid="PlaceHolderMain".
    Hope it helps.
    Xue-Mei Chang

  • Create Custom list form and validate fields using sharepoint designer 2010

    Hi All,
    I have a requirement to create a custom job application form which will be filled and submitted by anonymous users. I have a an option to create custom user control web part but I wanted to
    create it using custom list form using SharePoint designer. My requirement is below
    Date of birth (user age should be above 22yrs )
    Email Validation
    Phone validation
    Resume attachment (should attach only word documents or PDF)
    Qualification (If other is selected then show textbox else hide)
    Can above validations be done using SharePoint designer (JavaScript or validation controls)? Or do I have to create custom control web part?
    MercuryMan

    Hello,
    I think jquery/javascript can be used to put validations on those fields. Fortunately some of validation can be done via sharepoint itself like: email, phone, age. For Attachment and Qualification fields use jquery/JS.
    See below link for column validations:
    http://thechriskent.com/2012/08/15/validate-phone-number-columns-in-sharepoint/
    http://sharepointsolutions.com/sharepoint-help/blog/2011/12/how-to-validate-an-email-address-using-column-validation-in-sharepoint-2010/
    See this for attachment:
    http://stackoverflow.com/questions/4234589/validation-of-file-extension-before-uploading-file
    For qualification:
    http://sharepoint.stackexchange.com/questions/88064/hide-show-field-on-list-form-based-on-value-from-another-field
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see<br/> Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • [Forum FAQ] How to remove div characters from multiline textbox field in SharePoint 2013

    Scenario:
    Need to avoid the div tags and get data alone from multiline textbox field using JavaScript Client Object Model in SharePoint 2013.
    Solution:
    We can use a regular expression to achieve it.
    The steps in detail as follows:
    1. Insert a Script Editor Web Part into the page.
    2. This is the complete code, add it into the Script Editor Web Part and save.
    <script type="text/javascript">
    ExecuteOrDelayUntilScriptLoaded(retrieveListItems, "sp.js");
    function retrieveListItems() {
    // Create an instance of the current context to return context information
    var clientContext = new SP.ClientContext.get_current();
    //Returns the list with the specified title from the collection
    var oList = clientContext.get_web().get_lists().getByTitle('CustomListName');
    //use CAML to query the top 10 items
    var camlQuery = new SP.CamlQuery();
    //Sets value that specifies the XML schema that defines the list view
    camlQuery.set_viewXml('<View><RowLimit>10</RowLimit></View>');
    //Returns a collection of items from the list based on the specified query
    this.collListItem = oList.getItems(camlQuery);
    clientContext.load(this.collListItem, 'Include(Title,MultipleText)');
    clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
    function onQuerySucceeded() {
    //Returns an enumerator to iterate through the collection
    var listItemEnumerator = this.collListItem.getEnumerator();
    //Remove div tag use a regular expression
    var reg1 = new RegExp("<div class=\"ExternalClass[0-9A-F]+\">[^<]*", "");
    var reg2 = new RegExp("</div>$", "");
    //Advances the enumerator to the next element of the collection
    while (listItemEnumerator.moveNext()) {
    //Gets the current element in the collection
    var oListItem = listItemEnumerator.get_current();
    alert(oListItem.get_item('MultipleText').replace(reg1, "").replace(reg2, ""));
    function onQueryFailed(sender, args) {
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    </script>
    Result:<o:p></o:p>
    References:
    http://www.w3schools.com/jsref/jsref_obj_regexp.asp
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Nice article :)
    If this helped you resolve your issue, please mark it Answered

  • 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

  • Add Data driven subscription option missing in sharepoint 2013

    i have a sharepoint 2013 enterprise version with sql server 2012 standard version. And i want to add Data- driven subscriptions for a document library by selecting manage subscriptions. But in the manage subscriptions Add Data- Driven subscription option
    is missing. How can i get the options. is ther any workaround if  i am using standard version.

    Hi sppanda,
    According to your description, you want to use data driven report subscription feature with SQL Server 2012 Standard.
    In Reporting Services 2012, only SQL Server 2012 Enterprise and Business Intelligence edition support the data driven feature. So it’s expected that the Add Data- Driven subscription option is missing in your environment. In your scenario, if you want to
    use data driven subscription feature, please perform edition upgrade.
    Reference:
    Reporting Services Features
    Upgrade to a Different Edition of SQL Server 2012 (Setup)
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • Attachment field in sharepoint 2013

    Hi,
    I have a custom list and customized the list using infopath 2013.Here i have created 2 views as Employee and manager.I have added one attachment field in both views.
    Here my problem is that i want manager should not able to delete the attachment attached by the employee but manager can able to open the attachment.
    Please help me to do this .
    Thank you!

    Only solution I can think of is to create 2 list and combine use them
    http://www.codeproject.com/Articles/194252/How-to-Link-Two-Lists-and-Create-a-Combined-Ciew-i
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/23961544-8d47-42c0-9ada-584ae94b04c8/linking-two-different-lists-in-sharepoint?forum=sharepointcustomizationlegacy
    http://social.technet.microsoft.com/wiki/contents/articles/15258.sharepoint-2010-how-to-link-two-list-and-create-a-combine-view.aspx
    Or 
    you need to custom code it

Maybe you are looking for