How to populate share point Login user into K2 Smart-form People picker Field


Badge +6

I have designed K2 Smart Form for Request Submission.I have a sharepoint Form Field called "Requester Name". While Loading i have to Pre-populate the currenly Login User into "Requester Name" Field.

Kindly Please help on this.


2 replies

Badge +7

Hi,

 

try out the below jquery, it gets you the logged in user name with repsect to SharePoint and map it back to the smartforms data label. i havent tried it completely, let me know if you face any issue.

 

 

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"> </script> <script type="text/javascript"> var thisUserAccount ; $(document).ready(function() { thisUserAccount= $().SPServices.SPGetCurrentUser({ fieldName: "Name", debug: false }); $('data label').val = thisUserAccount; } ); </script>

 

 

Hope it helps!

 

Cheers,

Prajwal Shambhu

Badge +6

Hi Prajwal Shambhu ,

Thanks a lot for Your quick reply. I am new to K2 BlackPearl.

Do you provide details about how to Refer Javascript in K2 SmartForm.

 
 

 

Reply