Setting the 'query field' on an InfoPath Data Connection

1.1k views Asked by At

I'm trying to follow some instructions with the first line:

1) Set the "query field" (Account Name in getUserProfileByName Secondary Recieve data source) to the Account Id of field selected in People Picker.

From here. But when I go try and edit queryfields it's greyed out? Ultimately I'm trying to populate fields when a user selects a user from a People Picker. Any help appreciated.

I'm using InfoPath 2013.

enter image description here

1

There are 1 answers

0
bÓ•developer On

To autocomplete this you'll have to use a support or population-related field, with a new action rule. This is due to people picker fields not allowing any action rules applied to them.

Condition:

  • Use the condition DisplayName is not blank by using "Select a field or group..." in advanced view and selecting your people pickers field

Actions:

  • Set a field's value
    • Field: data connection queryFields DisplayName of people picker
    • Value: your forms DisplayName of people picker
  • Query using a data connection: getUserProfileByName / User Information List
  • Set a field's value
    • Field: your forms Department field
    • Value: data fields > Department of your data connection

Please note: getUserProfileByName / User Profile Service Data Connection no longer works in SharePoint Online and results in an error 5566. Please use a SharePoint list data connection to the hidden User Information List on the stem of your SharePoint site instead. It provides you with most of the same fields you'd find in getUserProfileByName, see below:

  • Name
  • Account
  • Work_email
  • Mobile_phone
  • About_me
  • SIP_Address
  • Is_Site_Admin
  • Deleted
  • Hidden
  • Picture
  • Department
  • Title
  • First_name
  • Last_name
  • Work_phone
  • User_name
  • Web_site
  • Ask_Me_About
  • Office
  • Picture_Timestamp
  • Picture_Placeholder_State
  • Picture_Exchange_Sync_State

Hope that helps!