1

I have an InfoPath form with a dropdown box, where I want users to be able to select which department they work in. Department details are stored in Managed Metadata :

Managed Metadata Service -> People -> Department -> [...]

I have managed to connect to the taxonomy service in PowerShell with this code, so I know which GUIDs I need to use :

Add-PSSnapin Microsoft.Sharepoint.Powershell

# Get the site collection
$sitecollection = Get-SPSite 'http://mysharepointsite/'

# Get the term store id
$taxsession = Get-SPTaxonomySession -Site $sitecollection

# Change to the requierd service name
$termstore = $taxsession.TermStores["Managed Metadata Service"] 
$termstore.id

# Get the term set id
$termstoregroup = $termstore.Groups["People"]
# Change to your term set name
$termset = $termstoregroup.TermSets["Department"]
$termset.id

This helped me work out the GUIDs for the Department set, and I got the following from the Managed Metadata :

  • Managed Metedata Service : 1856a97abc824059be14f9803d3bc5fd
  • People : 4ee799fd-a4b4-44f4-b9bd-ce3e6d7d877e
  • Department : 8ed8c9ea-7052-4c1d-a4d7-b9c10bffea6f

However, whenever I do the following process, my data source always comes up as empty :

enter image description here

enter image description here

enter image description here

Here I went with GetTermSets but only because it seemed to have the right amount of GUIDs, but I have no idea if this is right! I have not been able to find any good documentation on this ...

enter image description here

GUIDs here are :

  • sspId : Managed Metadata Service GUID
  • lcid : United Kingdom LCID
  • termId : People GUID
  • termSetId : Department GUID

enter image description here

As you can see, there is no data available :

enter image description here

And after clicking OK here, I get the message You must select a repeating group or field

enter image description here

There doesn't seem to be any good information on this anywhere but it feels like something that should be relatively simple (considering the data already all exists on a basic web service ... ) really appreciate any help or guidance on this

0

I finally managed to do this with the following procedure :

Step 1 Set up the Data Connection:

Data -> Data Connections -> Add -> Receive Data -> SOAP Web Service -> http://sitename/_vti_bin/userprofileservice.asmx -> GetUserProfileByName

Check Automatically Retrieve Data When the Form is Opened


Step 2 Create a Hidden Field

Set hidden field's Default Value (in Properties) to:

Insert Field or Group -> Show Advanced View -> Select GetUserProfileByName datasrouce -> expand dataFields all the way to Values, select Value -> Filter Data -> Add

(Property Data) Name is equal to (type text) Department


Step 3 Set up the Rule

Add Rule (Formatting) -> Condition: (HiddenField Equals IT(or other department name) -> Tick "Hide this Control" (this can also be applied to a group)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.