Adding dropdown field values in dependence of preconditions - InfoPath Dev
in

InfoPath Dev

Adding dropdown field values in dependence of preconditions

Last post 01-12-2009 10:46 PM by Anuma. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 12-23-2008 03:40 AM

    Adding dropdown field values in dependence of preconditions

    Hello,
    In a dropdow field I want to add additional values after defined preconditions become true.
    E.G.: When "field1" is == true add aditional value "A new row" in dropdown list "mydropdownlist".
    The whole dropdown field is filled manually.

    Thank you very much indeed for helping me!

  • 12-23-2008 04:09 AM In reply to

    Re: Adding dropdown field values in dependence of preconditions

     Hi,

    We cannot the data in to a drop down manually when a condition is true. The work around is, use a secondary data source as xml and add the values in that xml when your condition is true. And use Look up values from external data source in drop down.

    Swathip
    www.ggktech.com
  • 12-23-2008 06:36 AM In reply to

    Re: Adding dropdown field values in dependence of preconditions

    Hey swathip,
    Thank's for your tip. The solution works fine :-)

  • 01-08-2009 06:57 AM In reply to

    Re: Adding dropdown field values in dependence of preconditions

    Hello again,
    Sometimes holidays are not god... I think that the the solution was working at the day of my last post.
    However, today it's not working. I bound an external data source and I also said that the data source shall be updated after the document is opened.
    I can do what ever I want. InfoPath allways shows me the state after the initial binding.
    How can I advise InfoPath to update the data source???

  • 01-08-2009 10:41 PM In reply to

    • Anuma
    • Top 25 Contributor
      Female
    • Joined on 07-20-2005
    • India
    • Posts 525

    Re: Adding dropdown field values in dependence of preconditions

    Hi,

    If you want to update the secondary data connection. Just modify your data connection once.

    Note: make sure you have backup for the Build.

    Anuma Chinthapalli /
    http://www.GGKTech.com
  • 01-08-2009 11:59 PM In reply to

    Re: Adding dropdown field values in dependence of preconditions

    Hi Anuma,
    I'm sorry, I don't get it. What do you mean with "Just modify your data connection once"?
    Maybe it's helpfull if I tell you what I did in order to get the values of the following xml-data which is located in c:\temp\participants.xml:

    <root>
     <executive>
      <email>[email protected]</email>
      <name>Max</name>
     </executive>
     <executive>
      <email>[email protected]</email>
      <name>MaxMax</name>
     </executive>
    </root>

    Please note that I use the german version of InfoPath. For this reason I can only make a out of my mind translation into the english form:

    1. Create dropdown field
    2. In dropdown properties go to "Add values from external source" and choose "add"
    3. Choose "Reply data" --> XML-Source --> Search (and choose xml-path) --> Insert data as ressource data --> Update data connection each time when the formular is openend --> Finish

    If I choose "Preview" now I can see above xml-values. 
    Now we come to the point:
    I add an additional executive tag an then I save the xml-document:
     <executive>
      <email>[email protected]</email>
      <name>MaxMaxMAx</name>
     </executive> 

    Now I close InfoPath and then I open  it again. Result:
    The update did not occur. I still see the first two values :-(

    What do I have to do???

     

  • 01-09-2009 12:13 AM In reply to

    • Anuma
    • Top 25 Contributor
      Female
    • Joined on 07-20-2005
    • India
    • Posts 525

    Re: Adding dropdown field values in dependence of preconditions

    Hi,

    1. Can you verify below steps.

    1. Open form in design mode.
    2. Select Tools à Resource Files.
    3. Click on add button and select your xml file.
    4. Select “Replace the existing file” option.
    5. Click on ok.

    Note: Make sure your new xml file and already added xml file name should be same.

      2. Otherwise extract you template into one folder. Now update “participants.xml” file from extracted folder. In this way you will see the newly added values in the infopath form.

     

    Anuma Chinthapalli /
    http://www.GGKTech.com
  • 01-09-2009 04:24 AM In reply to

    Re: Adding dropdown field values in dependence of preconditions

    Hi,

    How you are adding the new data. I mean from where you are opening the xml? I think you are updating the xml on your local file. Follow the steps as Anuma said, and then you will get the updated values in to the drop down.

    Swathip
    www.ggktech.com
  • 01-10-2009 03:51 AM In reply to

    Re: Adding dropdown field values in dependence of preconditions

    Thems that I do a mistake at one essential piont. Maybee it's point four in your description. I cannot replace anything. Instead I have two sources: 1. participants; 2. participants.xml.
    I think it's easier (and faster) for you to help me if you can see what I did. Therefore I created a screencast which shows the creation process including your advises. You can find it here: http://www.dataworks24.de/temp/InfoPathDopDownProblem/InfoPathDopDownProblem

    In this screencast is it tracable for your where I made the mistake?

  • 01-12-2009 10:46 PM In reply to

    • Anuma
    • Top 25 Contributor
      Female
    • Joined on 07-20-2005
    • India
    • Posts 525

    Re: Adding dropdown field values in dependence of preconditions

    Hi,

    I verified your demo. Actually, this is working correct in the Infopath2003 machine. I also faced same issue in infopath2007 machine.

    In infopath2007, Xml file is showing as “participants” instead of “participants.xml” in the resource files.

    Here you have two options.

    1. Extract your template into one folder before updating the xml file.
    2. Other wise remove “participants” file from resource files which you created first. I mean old file. Removing the Old xml file from resource files will not effect anything in your form.

     

    Anuma Chinthapalli /
    http://www.GGKTech.com
Page 1 of 1 (10 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.