far_CF
Scholar

Auto populate user name and associated company field

Hello Nintex Community! 

 

I am looking for some help to pull and auto-populate a field. In the form we are building there is a field for user name (text field) and company (drop down). In the default value for user name we are using the Context function to get "Current display name". In the company field I want it to auto-populate the company based on the user's name. Both these fields are read-only fields as we don't want users to adjust the company name field. 

 

The requirement is to have a user login and every time they fill out a new form they can see their name and company but not be able to change those fields. 

 

I am using the new responsive designer to build the form. 

 

Thank you for your help!

Labels: (2)
0 Kudos
Reply
4 Replies
David-
Apprentice

Re: Auto populate user name and associated company field

Is the information you want to populate from the person who submits the form? If so, this is pretty easy. I just create a rule and use the user profile service to get the required information:

David-_0-1619811490253.png

Here is the full text for the function for the work phone value:

  • userProfileLookup([Context].[Current user email],"WorkPhone")

You can then make the fields on the form read only. This site has all of the fields you can pull from the user profile service: 

http://www.techrobbers.com/2019/07/sharepoint-user-profile-fields-with.html

Reply
far_CF
Scholar

Re: Auto populate user name and associated company field

Thank you David for the quick response! 

I should have probably mentioned this in my post but unfortunately the user accessing the form is an external user. We are adding them to our internal tenant to access the form so we don't have a lot of information that we can pull from their User Profile.

 

However I did use the concept you suggested in your rules section. I used the following rule to build out the logic.

1. IF: "Form Is New" ..... is Yes

2. AND User name.... *enter user name*

3.Then: Company Name.... Value.....  companyABC

4. Else: Company Name... Value..... *blank*/companyDEF

 

It works great for our needs and really simplified our process.

Thanks again 🙂 @David-

0 Kudos
Reply
far_CF
Scholar

Re: Auto populate user name and associated company field

@David- 

Hi David - I was using the "is New Mode" to test the form today and for some reason my rule no longer works. Does the "is New mode" only for when I first use the form??? Do I need to add more to the rule?? 

We know the user will use the form multiple times throughout the week, so is the form still "new" when they fill out the form over and over again? 

0 Kudos
Reply
David-
Apprentice

Re: Auto populate user name and associated company field

Yes, "new mode" is the first time you create the new item in the list. Once it is saved, it is no longer considered new.

Reply