'Infopath Newbie - Populate field from lookup value

There are explanations for this all over the web, but none I have followed a) seem to work, b) explain how to achieve this in simple noob terms, c) show any sort of diagram, or d) make assumptions that you want to start jumping right into code...

I have a form for users to log training they have completed. I have a sharepoint list with the course name and the duration in hours.

When the user opens the infopath form, it populates a read-only field with their username, and populates a dropdown with the list of available training courses from my sharepoint list.

All I want to do is to populate another read-only field with the duration of the course... But I just cant find the right filter settings to do it.

Currently I have the default value of the duration field in my form set to the formula:

Duration(from SP list)[Course Title (from SP list) = Training Course (from form lookup field)]

But this is not returning any values...

This is using both SP 2010 and IP 2010



Solution 1:[1]

Ok, you use rules, not the default value, as pretty much every website I have looked for answer tells you...

Make sure the default value for the field you want to populate is blank, and then set a rule that when your lookup field value changes, it updates the value in your other field...

That was easier than I thought!

Solution 2:[2]

This is soemthing called a cascated drop down there are various examples of this on the web.

To do this you need to click on the drop down box that you want to filter. This will be the duration. (The user would then select the course they went on)

In the duration drop down below you would ensure that you have connected it the correct data source. Right click on the duraction drop down.

  1. Drop down list properties
  2. get choices from external data source
  3. on the entries you would select the button to the right hand side
  4. You would select 'course title now as this is what you want it to be filtered by' (drop down above)
  5. When selected you would click filter data - (button on bottom right hand side)
  6. You would then filter it so the formula is 'CourseTitle(above drop down) 'is equal to' CourseTitle(data source from the list)'

This then should only allow them to match select the time that matches that course.

If this doesnt work let me know.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 user2274903
Solution 2 Jack