Infopath rules depending on the user Country
-
09-12-2020 - |
Domanda
How can I use the "UserProfileService" web service in InfoPath to retrieve the "Work Address" of a user?
I am trying to have some rules around the user Country.
Soluzione
First of all , you should be aware of there's no work address
attribute for the user account at AD so you will not find such this property at mapped user profile properties,
Meanwhile,there's a country / region
attribute . but Unfortunately, by default it is not mapped to User Profile properties, to find the default mapped properties ,check the full list at Default user profile property mappings in SharePoint Server 2013 from AD DS attribute
So now you need first to add new map property at user Profile for country attribute then try to build your rule based on this property at InfoPath as the following :
Add a new mapped property
In central Administration > Manage Service application > select UPS Service> People> Manage User Properties > New Property.
Select Type integer > Attribute CountryCode.
Then retrieve user profile properties with Country code via InfoPath as the following :
- First, you should create a data connection from SOAP web Service at Data Tab
Select Receive Data and next then add UserProfileService web service URL via
http://yoursitename/_vti_bin/UserProfileService.asmx?WSDl
Select Get
GetUserProfileByName
Now you can Create a rule with country code .
Check how to create the rule GetUserProfileByName at infopath