none
[URGENT]Autopopulate username as per current login user RRS feed

  • Question

  • i have infopath form where i have to perform the below requirement

    Username: To Auto populate from the current login user and non editable

    Manager: To auto populate with the above user name's manager name from the active directory and this is editable


    Blitz




    • Edited by sree_23 Wednesday, October 9, 2019 1:50 PM
    Wednesday, October 9, 2019 11:48 AM

Answers

  • Hi Blitz,

    You can create two single line of text columns for Username and Manager column.

    Then customize the form as below:

    Auto-populate current login user:

    1. Click the DATA tab, then click From SOAP Web Service under From Web Service.
    2. Enter the location of the SOAP Web service definition: http://<site>/_vti_bin/userprofileservice.asmx, then click Next.
    3. Select GetUserProfileByName and click Next.
    4. Make sure ‘Automatically retrieve data when form is opened’ is checked.
    5. Right click the Username text control->Text Box properties, in the “Default Value” section, click the “fx” button.
    6. Click “Insert Field or Group…”. IN the data sources drop down, select the GetUserProfileByName.
    7. Choose the “Value” field and click the “Filter data…” button.
    8. Click “Add…”, select “Select a field or group…” and select “Name”, leave the middle drop down as is (‘is equal to’) and in the last drop down choose ‘type a text…’, type “PreferredName”.

    Make Username column not editable:

    Click the Username column, click “Manager Rules” button in the HOME tab, create a Formatting rule, set “username is not blank” in the condition section and tick “Disable this control”.

    Auto-populate manager column:

    1. Right click the manager control, click “text box properties”, in the “Default Value” section, click the “fx” button.
    2. Click “Insert Field or Group…”. IN the data sources drop down, select the GetUserProfileByName.
    3. Choose the “Values” group and click the “Filter data…” button.
    4. Click “Add…”, select “Select a field or group…” and select “Name”, leave the middle drop down as is (‘is equal to’) and in the last drop down choose ‘type a text…’, type “Manager”.

    Best regards,

    Grace Wang


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    • Marked as answer by sree_23 Thursday, October 10, 2019 8:39 AM
    Thursday, October 10, 2019 7:30 AM