Conditionally Populating InfoPath fields using XML Datasource - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Conditionally Populating InfoPath fields using XML Datasource

Last post 01-19-2010 08:27 AM by Karthik V Mainampati. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 01-15-2010 03:39 PM

    Conditionally Populating InfoPath fields using XML Datasource

    Hello,

    I am using InfoPath 2007 and I have a repeating table which has the following columns.

    1. Question Number (Textbox, whole number type)

    2. Question Name (Textbox, string type)

    3. Answer (Radio Button, whole integer type). This has Yes, No and N/A as

    4. Score (Textbox, integer type)

    5. Comment (Textbox, string type)

    I have a XML file as a secondary data connection which populates the Question Name, Score and Comment fields dynamically in the InfoPath form based on the User's answer. Basically, this form was designed for a survey and it has tens of questions and these questions are related to one another, meaning when a user selects an answer for one question, the related question's score and comment should change dynamically. For example, when a user selects a "Yes" answer for question number 1, the third question should have a Score of "0" and Comment as "N/A" and the user shouln't be allowed to pick an answer for question number 3.

    I was trying real hard to accomplish this by modifying the XML I have. But I wasn't sure about how to modify my XML and how to configure the InfoPath UI fields so that I would get what I was looking for. Any help would be greatly appreciated.

    Filed under:
  • 01-17-2010 03:20 PM In reply to

    Re: Conditionally Populating InfoPath fields using XML Datasource

    Do you mind attaching what you have thus far to a reply? Under the Options tab, you can attach a file. It may help others understand a bit better what you are trying to do, and help you without having to create a sample form.

    Hilary Stoupa

  • 01-17-2010 06:41 PM In reply to

    Re: Conditionally Populating InfoPath fields using XML Datasource

    Hi Hillary,

    Thanks very much for your response. I attached the form as you requested. In the form, the questions 1 and 3 are related. The user shouldn't be allowed to pick an answer for the Question 3 if the user selects an answer for the Question 1 as "No". The Score and Comment for Question 3 should automatically be blank. I know I can do this if I am not using the repeating table. But I want to use Repeating table because it's just lot easier.

    Please let me know if you have any thoughts or suggestions.

    Filed under: ,
  • 01-18-2010 05:25 PM In reply to

    Re: Conditionally Populating InfoPath fields using XML Datasource

    Ah, I see now. The issue is that using built in InfoPath functionality, you can't filter the target of a rule.

    You have several options. You can use qRules to set a filtered field's value. You can manually modify the manifest file. You can use the conditional double eval method. I suppose, also you could use code.

    Hilary Stoupa

  • 01-19-2010 08:27 AM In reply to

    Re: Conditionally Populating InfoPath fields using XML Datasource

    Hi Hillary,

    Thanks again for your response!! I modified the Manifest file as you have suggested. It works great. In the attached form, I set up a rule such that when a user selects "No" for Question 1, the answer for Question 3 would automatically be "N/A" and the user will not be allowed to change the answer from N/A as long as the answer for Question is "No".

    What I also wanted to do was apply conditional formatting (disable control) to Question 3 such that the user would know he.she is not allowed to pick an answer. Is there any way to do this without code?

    I greatly appreciate your help.

Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.