cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Nintex Newbie

get js value from SPService to display in nintex form

Jump to solution

Good Day,

I have the following code and I am trying to get the values and store them into corresponding text boxes.  Any one have any information on how to do that?

NWF$(function () { $(document).ready(function() {

     var thisUsersValues = $().SPServices.SPGetCurrentUser({

     fieldNames: ["ID", "FirstName", "LastName"],  

     debug: false

      });

});});

Thank you,

Jennifer

0 Kudos
Reply
4 Replies
Highlighted
Automation Master
Automation Master

Re: get js value from SPService to display in nintex form

Jump to solution

Which version of SharePoint do you have (Foundation, Standard or Enterprise) ?

If you have the Standard or Enterprise one, you can do it with a calculated value control and the userProfileLookup function.

Do you want to just display those information or do you want to prepropulate text boxes ?

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: get js value from SPService to display in nintex form

Jump to solution

We have enterprise and I want to populate a textbox.

Thank you,

Jennifer

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: get js value from SPService to display in nintex form

Jump to solution

I got it; I need to do this...

NWF$('#' + varFirstName).val(thisUsersValues.FirstName);

Thanks,

Jennifer

View solution in original post

Reply
Highlighted
Automation Master
Automation Master

Re: get js value from SPService to display in nintex form

Jump to solution

That's a possibility.

If you want to get other properties from the user profile, you can use a calculated value to get the information from the user profile using the userProfileLookup function and in the calculated value call your javascript function with the user profile property as a parameter like this :

myJavaScriptFunction(userProfileLookup(Current User,"PreferredName"))

Your javascript function could look like this to populate a textbox control with the parameter :

function myJavaScriptFunction(userProfileProperty) {

     NWF$('#' + controlClientID).val(userProfileProperty);

}

Hope this helps

Reply