0

I have a list in SharePoint that is:

ID           |           Title              |    Job
1            |           Bob                |    Painter
2            |           John               |    Carpenter
....

I have a dropdown list in the form that lists all of the options (Bob, John, etc.). I have a hidden field, hdnJob, that apparently (I inherited this InfoPath form so I assume that is what it is for, looks like it from the code behind that I had to decompile from the DLL) stores whatever the Job value is for the selected item in the dropdown.

How can I make it so where when ddlPerson's selected value changes, hdnJob is updated to the Job value (ie if I select John, with ID 2, hdnJob changes to Carpenter)

edit: Mohamed got me headed in the right direction (thanks). The thing I was having issues with in regards to the instructures was selecting the underlying data connection's data. All I saw were the form fields. Make sure you click the dropdown at the top (for me, it was set as "Main" and then select the data connection's name. From there, I believe it was dataFields, and the field Job). Everything else he lists should have you good to go.

1

You need to add a rule on the dropdown list of type action, this rule will set the value for this hidden field, then you choose your data connection, and choose the Job Field, then choose filter, and choose where Title (from the connection), equals the current value of the dropdown list.

  • I think I'm partially there. I added a new rule to the dropdown list of type action, in Run these actions* I add set field's value, select hdnJob. At this stage, I don't see where I select the data connection and so forth. I can save that as is and then add a new action for querying data and then select UserList, but I don't see a method to do the update. I see the Value part of the set a field's value area, but don't see anything to select data from the data connection UserList. – Robert Mar 7 '15 at 2:08
  • When you choose set field value, from the Fx button, choose field or group (can't remember exactly the button's text), then from the dropdown for the data connection choose the data connection that's the source for your dropdown list, then click on the hdnJob, when you click you will find on the right something called filter values as this represents a collection, but you need only 1 item, so you need to make a Where clause, so you click on Filter, and choose where the value of the Title = the value of the current control (dropdown) so it will be represented by a dot (.) – user19105 Mar 7 '15 at 2:27

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.