Skip to main content

Search

Execute Script Action - Calling REST Service and Populating Fields

Comments

3 comments

  • ArdeviaForum

    Original Post by Liliia (Imported from Ardevia Forum)

    Hello,

     

    Please try this code:

    Code:

     

    jQuery.ajax({
        type: "GET",
        contentType: "application/json; charset=utf-8",
        url: "https:///_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v='i:0%23.f|membership|"+[[Requestor.Email]]+"'",
        data: "",
        dataType:"json",
        success: function(resp){  
            alert(resp.UserProfileProperties[10].Value);
    var inputController = jQuery('span.ms-formbody[fieldname=""]').closest('.ard-formfield').data('Controller');
    var val = resp.UserProfileProperties[10].Value;
    inputController.InstanseData.SetValue(val);  
        },  
        error: function(e){  
            alert(e.Message);  
        }  
    });
    

     

     

     

    and let me know if it is helpful.

    0
  • ArdeviaForum

    Original Post by PJamhour (Imported from Ardevia Forum)

    Hi Liliia,

     

    That is exactly what I was after.
    Thank you very much.

    0
  • ArdeviaForum

    Original Post by Liliia (Imported from Ardevia Forum)

    You are always welcome! Please feel free to contact us in case of further difficulties.

    0

Please sign in to leave a comment.