How to write FQL in querytext field in SharePoint 2013 Search REST API?

I am having double quote symbol issue in my search app, same as http://www.silver-it.com/node/127 says.
To avoid this issue, I am trying to understand: is it possible to do search request in FQL to the 2013 Search REST web service?
I know that we can use KQL in querytext, like
http://sp2013/sites/search/_api/search/query?querytext='Title:"123#123"'&enablefql=false&rowlimit=100&selectproperties='Title'
But is it possible to write it in FQL? I found that there is a enableFQL property we can set in REST API. What's the function of it?
http://sp2013/sites/search/_api/search/query?querytext='test'&enablefql=true&rowlimit=100&selectproperties='Title'
http://sp2013/sites/search/_api/search/query?querytext='string("test case",mode="simpleall")'&enablefql=true&rowlimit=100&selectproperties='Title'
Right now, the two above requests just give me this error.
HTTP/1.1 500 Internal Server Error
{"error":{"code":"-1, Microsoft.Office.Server.Search.REST.SearchServiceException","message":{"lang":"en-US","value":"We didn't understand your search terms. Make sure they're using proper
syntax."},"innererror":{"message":"We didn't understand your search terms. Make sure they're using proper syntax

http://sp2013/sites/Search/_api/search/query?querytext='string("cat+dog+fox",+mode="and")'&enablefql=true&rowlimit=100&selectproperties='Title'&sourceid='ad5a2ca4%2D91eb%2D44de%2D98f7%2D9af1c1eefef3'
The response is:
HTTP/1.1 400 Bad Request
{"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)."},"innererror":{"message":"Guid should contain 32 digits with
4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).","type":"Microsoft.SharePoint.Client.InvalidClientQueryException","stacktrace":"   at Microsoft.SharePoint.Client.Rest.EdmClientValue.ConvertTo[T]()\r\n   at Microsoft.Office.Server.Search.REST.SearchServiceServerStub.query_MethodProxy(SearchService
target, ClientValueCollection xmlargs, ProxyContext proxyContext)\r\n   at Microsoft.Office.Server.Search.REST.SearchServiceServerStub.InvokeMethod(Object target, String methodName, ClientValueCollection xmlargs, ProxyContext proxyContext, Boolean&
isVoid)\r\n   at Microsoft.SharePoint.Client.ServerStub.InvokeMethodWithMonitoredScope(Object target, String methodName, ClientValueCollection args, ProxyContext proxyContext, Boolean& isVoid)\r\n   at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.InvokeMethod(Boolean
mainRequestPath, Object value, ServerStub serverProxy, EdmParserNode node, Boolean resourceEndpoint, MethodInformation methodInfo, Boolean isExtensionMethod, Boolean isIndexerMethod)\r\n   at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.GetObjectFromPathMember(Boolean
mainRequestPath, String path, Object value, EdmParserNode node, Boolean resourceEndpoint, MethodInformation& methodInfo)\r\n   at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.GetObjectFromPath(Boolean mainRequestPath, String path, String
pathForErrorMessage)\r\n   at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.Process()\r\n   at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.ProcessRequest()\r\n   at Microsoft.SharePoint.Client.Rest.RestService.ProcessQuery(Stream
inputStream, IList`1 pendingDisposableContainer)"}}}

Similar Messages

  • How can I access user permission for specific items in Sharepoint 2013 via REST API?

    I want to access user permissions for specific items like lists, documents, folders etc. via the REST API.
    Currently I am hitting the following endpoint:
    http://win-5a8pp4v402g/sharepoint_test/site_1/_api/web/getUserEffectivePermissions('win-5a8pp4v402g\\Sharepoint User 2')
    However the response looks like this:
       "d":
           "GetUserEffectivePermissions":
               "__metadata":
                   "type": "SP.BasePermissions"
               "High": "0",
               "Low": "0"
    I cant understand why high and low are both 0? I have added the user to a specific group. Also this is the same result for each of the users. Another thing to note is that I havent added the "Guest" user in the sharepoint server. So when I hit the endpoint for the Guest user, it still shows the same response. So I know there is something I am doing wrong.I want to access permission of a user for a specific item, say a document using the REST API. Can someone tell me how? What would be the endpoint?

    Thanks for the reply. Although this works for Lists, I need to get permissions of documents too. Here is what I have tried:
    http://win-5a8pp4v402g/sharepoint_test/site_1/_api/web/GetFileByServerRelativeUrl('/sharepoint_test/site_1/Documents/file1.txt')/GetUserEffectivePermissions(@user)?@user='i%3A0%23%2Ew%7Cwin-5a8pp4v402g%5Csharepoint%20user%201'
    And the response is:
       "error":
           "code": "-1, Microsoft.SharePoint.Client.ResourceNotFoundException",
           "message":
               "lang": "en-US",
               "value": "Cannot find resource for the request GetUserEffectivePermissions."
    Clearly this doesnt work for a file. Whats wrong?

  • Person search to metadata field with search REST API on SP2013 online

    Hi!
    I'm developing a sandbox solution to be deloyed on SharePoint 2013 online. This solution contains a web part for a custom functionality. I have a need to make a query against data in user profiles based on two custom metadata properties (mapped to termsets).
    Is it possible to create this kind of query by using search REST API (with javascript)? So I need all persons whos metadata field
    MyOwnTerms contains specific value(s) passed to search?
    I can get all users with /_api/search/query?querytext='*'&sourceid='B09A7990-05EA-4AF9-81EF-EDFAB16C4E31'very (if i set the rowlimit to very high) and the results contains my cystom field
    MyOwnTerms but there is too much of results to loop through just for filtering. I cannot reduce rowlimit because I need ALL the persons with certain metadata value in this field. Is there any way to make this work?
    .Ana

    I went through the same problem and yes it is possible. In my case, I created a Managed Properties specific to my site column metadata, and assign the value only the label of the column metadata for this managed property. So it returns only the value of
    the name and not the metadata ID | Name as the default. 
    So, just move on selectproperties the name of your managed metadata, so it returns the correct value.

  • 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

  • How many server licenses do I need for SharePoint 2013?

    I am new to the concept of CAL. I am reading about it. I found this linkhttp://sharepoint.stackexchange.com/questions/101914/how-many-server-licenses-do-i-need-for-sharepoint-2013
    Suppose there are 2 users in the sharepoint farm. As per above link we requires 7/8 server license. So my question is do we requires 7/8 licences per user basis (2*7/8) or we requires 7/8 licences once only then we require 2 more licenses for 2 users (7/8 +2)?

    The second option.
    If you have 7 SharePoint servers then you need 7 SharePoint Server Licenses.
    If you have two people in your company who can use SharePoint then you need two Client Access Licenses (7 server, 2 CAL).
    If you had two hundred thousand users who could then you would need two hundred thousand CALs, but the number of server licenses would not change. (7 server, 200,000 CALs).

  • 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

  • [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

  • How to Construct the Email To activity in SharePoint 2013 Workflow

    I have a created a custom workflow and custom association and initiation form using SharePoint 2013.
    My Assn. form is fine.  I pass in the people picker (Active Directory group) value to my workflow just fine.
    Now on my Init form I use the passed in value from people picker and display a list of users and email addresses from the people picker group.  The list of users and email addresses are listed in a table with a check box to the left of each row. I am
    using JQuery, Knockout and MVC web service to retrieve the values from the group.
    All is well.
    Now my users pick who they want to send the email to.  Let's say they pick two users!
    When the user clicks the submit button, I have JSOM code which starts the workflow and sends in the 2 users email addresses as an argument to theworkflow.
     Note:  I tried sending my two emails as a collection and failed.  So i converted it to a string.  The variable is called strUsers.
    Since the argument is a string and Email Activity requires the To attribute to be an array, I use the BuildCollection<String> Activity to convert my string to an array.
    Now in my workflow I use WriteToHistory Activity to write out my BuildCollection variable (recipients).  Here's what is sent to the workflow history... [email protected];joejones@yahoo,com)  Note:
     Both names are bogus and I'm not Joe Jones.
    I then configure the email Activity and set to To property to my BuildActivity variable (recipients).
    When I deploy my Visual Studio 2013 solution, and attach my workflow to a publishing page, I am getting this error after I submit the Init form.
    An unhandled exception occurred during the execution of workflow instance.  System.ArgumentNullException.
    Does anyone know of an example of how to set up the Email To collection value.
    Note:  I tried using comma and semi-colon for my string (strUsers).  Neither worked.
    Thanks
    Tom
    none

    I think I'm getting close.
    Here’s an
    article
    that helped me out and below is my code.  Note:  I added a ParseDynamicValue and GetDynamicValueProperty to push the data from the "emails" property to colleciton of strings called EmailCollect.
    Here is what the data look likes
    The value of Selected Emails is [{"emails":"[email protected]"},{"emails":"[email protected]"}]
     Code excerpt in InitiationForm.  Note:  I am using MVVM and Knockout for the selected users from a list with checkboxes.
                    //build array for workflow 
                  var emailUsers =
    new Array();
                    //cycle through viewmodel emails
    for (var
    i = 0; i < viewModel.SelectedEmails().length; i++)
    var a =
    new Object();
                        a["emails"]
    = viewModel.SelectedEmails()[i];
                        emailUsers.push(a);
    wfParams['strSelectedEmailsHMgr']
    = JSON.stringify(emailUsers);
                     // Get workflow subscription
    and then start the workflow
    var context = SP.ClientContext.get_current();
    var wfManager = SP.WorkflowServices.WorkflowServicesManager.newObject(context, context.get_web());
    var wfDeployService = wfManager.getWorkflowDeploymentService();
    var subscriptionService = wfManager.getWorkflowSubscriptionService();
                    context.load(subscriptionService);
                    context.executeQueryAsync(
    function (sender, args) {
    // Success
    var subscription =
    null;
    // Load the workflow subscription
    if (subscriptionId)
                                subscription = subscriptionService.getSubscription(subscriptionId);
    if (subscription) {
    if (itemId !=
    null && itemId !=
    // Start list workflow
                                    wfManager.getWorkflowInstanceService().startWorkflowOnListItem(subscription,
    itemId, wfParams);
    Now I deploy and publish the workflow but now I’m getting this error when trying to 
    System.InvalidOperationException: Looking up a value using a key is not supported on an instance of 'Microsoft.Activities.Dynamic.DynamicJsonArray'. at Microsoft.Activities.Dynamic.DynamicItem.TryGetValue(String
    key, DynamicItem& value) at Microsoft.Activities.Dynamic.DynamicValueBuilder.PathSegmentFactory.ObjectPathSegment.Get(DynamicItem obj) at Microsoft.Activities.GetDynamicValueProperty`1.Execute(CodeActivityContext context) at System.Activities.CodeActivity`1.InternalExecute(ActivityInstance
    instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
    none

  • How to determine mime type of multi-part message uploaded to rest api?

    I have a rest api that is used to upload data from different types of clients and serves as a proxy to write data to Azure blob storage. For testing, I'm using Fiddler on a PC.
    The code in my rest api that writes to blob storage looks like this:
    try
    await blockBlob.UploadFromStreamAsync(requestMessage.Content.ReadAsStreamAsync().Result);
    catch (Exception ex)
    HttpResponseMessage _hrm = new HttpResponseMessage(HttpStatusCode.InternalServerError);
    _hrm.ReasonPhrase = ex.Message;
    throw new HttpResponseException(_hrm);
    1 - How can I access the form-data that is included in the POST that has the original file name and the content-tyipe?
    2 - How can this info be passed to the blob when I write it out?  Currently, it is written out as a type of application/octet-stream instead of video/mp4.

    I think I found a solution using some other threads.  I'm not sure if it's the most performant or best but I'm able to get to the content-disposition and the content-type of the stream to get the details:
    Dictionary<string, string> lstLines = new Dictionary<string, string>();
    string[] _tmp;
    TextReader textReader = new StreamReader(requestMessage.Content.ReadAsStreamAsync().Result);
    string sLine = textReader.ReadLine();
    Regex regex = new Regex("(^content-type)|(^content-disposition)", RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.Singleline);
    while (sLine != ""
    && sLine != null)
    if (regex.Match(sLine).Success)
    _tmp = sLine.Split(':');
    lstLines.Add(_tmp[0], _tmp[1]);
    sLine = textReader.ReadLine();

  • How to edit Information of a user in sharepoint 2013.

    hi,
    i am trying to update user information in sharepoint 2013.but the user information form is uneditable ,
    when i click on Edit item link the window pop up with only attachment field.
    how to enable the fields on form?
    any help would be appriciated.
    Thanks !!!

    http://social.technet.microsoft.com/Forums/sharepoint/en-US/53c1e539-891e-4400-83e0-100cd44c52eb/editing-the-user-information-list
    If you disable the my site function, it won’t bring you to the my site.
    For more information about disconnect the USER Profile Service, please refer to
    http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/f012d1b0-3605-4124-8695-9afda112ecd8
    But
    Even though you can go to the display/edit form of the user list, you also can’t edit the information.
    Hope this helps
    Also check
    http://blog.falchionconsulting.com/index.php/2011/12/updating-sharepoint-2010-user-information/
    http://sharepoint911.com/blogs/laura/Lists/Posts/Post.aspx?List=daba3a3b-c338-41d8-bf52-cd897d000cf3&ID=65&Web=dbb90e85-b54c-49f4-8e97-6d8258116ca0
    If this helped you resolve your issue, please mark it Answered

  • How to properly create and configure SharePoint 2013 Search service with PowerShell?

    Hello Forum,
    I have installed SharePoint 2013 across three tier servers:
    WFE Server  (Of course, SharePoint is installed here. Bsically this is just a Web server)
    APP Server  (Of course, SharePoint is installed here + Central Admin + Service Apps).
    SQL Server  
    I now want to create and configure the Search service, obviously on the APP Server, But of course the search functionality should work correctly on the WFE server to.
    I want to do this via a proper PowerShell script. I found Spence Harbar's script on: (http://www.harbar.net/articles/sp2013mt.aspx), But it has three problems, and they are as follows:
    1) Spence Harbar himself literally stated on his article that this script is for: "deploying on a single server farm", But what if I have three tier servers? Could anyone please help me out in suggesting the required tweaks in the
    script?
    2) By default Search uses the SP_Farm account, So, How can I change the script to use other dedicated account for the search service e.g. SP_SearchAcc ?
    3) How can I modify the script to specify a default Search center?
    4) Apart from all the three aforementioned point - Is the script missing anything? 
    I would greatly appreciate your inputs - Thanks !

    the only differences are where you place the components.  if you are doing a small server farm with a 1-1-1, most likely you just need to change the script so that you set the index and query processing component on the front end, but the others on
    the app server.  just a 2 second update... just keep in mind this will work, but I am making several assumptions without any knowledge of your farm, users, capabilities. 
    generally, there would be more of a breakout on the topology than that, but im guessing for this farm that you wont have dedicated search servers.  also, a lot depends on # users (rps really), # items in index, size of VMs (RAM for query processing,
    Disk for index, etc, etc), and making sure the topology works for your particular environment and needs. 
    if you want more detailed topology help, which aligns as closely as possible to "best practices" (not that those exist in SharePoint, go ahead and provide the total # users, average/peak RPS for search, current index size, content source types,
    VM specs RAM, CPU, #/Size of drives, HA concerns/priority (obviously isn't, since only 1-1-1)
    Christopher Webb | MCM: SharePoint 2010 | MCSM: SharePoint Charter | MCT | http://christophermichaelwebb.com

  • How to delete Content Source in Sharepoint 2013 Search Service

    I want to delete Default Content Source in Search
    Service in SharePoint 2013 but delete button is disable?Please see the below image. Content Source Type=SharePoint Sites
    How to do it?
    If In Content Source type=Files than delete button enables but
    not for the Content Source type=Sharepoint sites
    Vishal Goyal

    Hi,
    try to remove it using powershell
    $searchapp = Get-SPEnterpriseSearchServiceApplication "NameofSearchAPp"
    Remove-SPEnterpriseSearchCrawlContentSource -SearchApplication $searchapp -Identity "Name"\Regards
    Whenever you see a reply and if you think is helpful,Vote As Helpful! And whenever you see a reply being an answer to the question of the thread, click Mark As Answer

  • How to open and read Excel Sheet from SharePoint 2013 Document Library using C# Visual Studio 2012

    Hi,
    To achieve these are the steps that I had followed :
    1. Add the document Library path into Central Admin -> Application Mgmt -> Manage Service App -> Excel Service App -> Trusted File Locations
    2. Add Documnet Library link to Trusted Connection Proivder
    3. Open Visual Studio as Run as Administrator
    4.Create an SharePoint 2013 Empty Project.
    5.Add Service Reference : http:\\<server>\_vti_bin/excelservice.asmx
    6.Service added successfully
    7.Create a class file and add the Service Reference namespace
    There is no such class as ExcelService to call. 
    Please let me know if somebody knows how to open the Excel file into C#(2012)  either using ExcelService or any other way to open. I tried old methods of Sharepoint 2010 server but it's not able to access classes.
    Requirement is :
    Need to read the excel sheet  from Document Library and transfer all data into DataTable.
    Please help asap. 

    Hi,
    This is the forum to discuss questions and feedback for Microsoft Office, I'll move your question to the SharePoint 2013 development forum
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/home?forum=sharepointdevelopment
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    George Zhao
    TechNet Community Support

  • How to migrate files from different databases to sharepoint 2013?

    Hello everyone,
    I need to migrate files of various formats from two databases to SharePoint 2013 ? How should I pursue? Please explain..
    Scenario : Two different databases on different systems have loads of files. I need to migrate them to SharePoint?
    Any suggestions/ Answers

    Hi,
    You need to copy the database into your network shared folder or SharePoint Server where you wanted to attach this content DB to your newly created web application.
    Hope and Afraid,
    Same Domain has been used. I mean if you move the content db from the server 1 which using the AD1 for authenticate the users,
    So your new server 2 and web application must have configured to authenticate the AD 1 users.Otherwise user not found exception will be thrown. 
    If not  still you can change the site collection administrator for the site which is migrated from the server 1.
    Murugesa Pandian., SharePoint 2010 | MCPD | MCTS |Configure

  • 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

Maybe you are looking for

  • Data Collection in Campus Manager hung

    /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in

  • Performance Reports

    Each time a published report is generated the previous version is overwritten ... is there some manner / way in order to archive them in a historical way and/or send them automatically attached to the notification E-mail. Furthermore is it at least p

  • [More information] 'SAP Best Practices Baseline package for Brazil V3.607'

    Hi. When I study 'SAP Best Practices Baseline package for Brazil V3.607', I wonder somthing. I want solution of problem. ---------Problem--------- In '100: SAP Best Practices Installation' document on point 3.4 Define Tax Jurisdiction Code it says En

  • Devfsadm not showing the external storage disk but able to see from OK

    Hi, I have an external storage disk. Solaris 9 is running on E220R Sun server. I am able to view this disk from the OK prompt using probe-scsi-all. I have installed SFS packages for V9 and the patches required also. MPXIO is also enabled on this serv

  • ASCII-EBCDIC convertion between z/Os and Linux

    Hi experts, we are migrating our landscape to z/Os (DB+ASCS) and Linux (PAS). We have our GLOBALHOST on z/Os but we are experimenting some problems when we try to install our application servers because the conversion between platforms. In the planni