Dropdown list items filtered by choice and Price from XML-file - InfoPath Dev
in

InfoPath Dev

Dropdown list items filtered by choice and Price from XML-file

Last post 12-14-2011 12:44 AM by Elmholt. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 12-09-2011 06:35 AM

    Dropdown list items filtered by choice and Price from XML-file

    Hello. I am working on a booking form for ordering mobil phone's. and I need the result in the 2'nd dropdown list to be depended on the choice in the 1'st dropdown list. I.e.I have a XML file with the mobile phone and price(pris):- <Row>  <Telefon>phone1</Telefon>   <Pris>200</Pris>   </Row>- <Row>  <Telefon>phone2</Telefon>   <Pris>250</Pris>   </Row>- <Row>  <Telefon>phone3</Telefon>   <Pris>300</Pris>   </Row> in the 1'st dropdown list you can choose between "Assistant" and "Controller" and Manager"and the 2’nd dropdown list you can choose the phone, but it has to filter on price depended on the choice from the 1’st dropdown list. So if you choose "Assistant" you only have the possibility to select Phone1 be course of the price. and if you select "Controller" you have the possibility to select both Phone1 and phone2, if you select "Manager" you have the possibility to select all 3.  It is quite difficult to explain, but I hope you get the point, and are able to help me.  Thanks.  Best regards Elmholt

     

  • 12-09-2011 03:54 PM In reply to

    Re: Dropdown list items filtered by choice and Price from XML-file

    Sounds like you need to modify your XML file to handle for this. Something like:

    <Rows>
      <Row>
        <Pris>200</Pris>
        <Telefons>
          <Telefon>phone1</Telefon>
        </Telefons>
      </Row>
      <Row>
        <Pris>250</Pris>
        <Telefons>
          <Telefon>phone1</Telefon>
          <Telefon>phone2</Telefon>
        </Telefons>
      </Row>
      <Row>
        <Pris>300</Pris>
        <Telefons>
          <Telefon>phone1</Telefon>
          <Telefon>phone2</Telefon>
          <Telefon>phone3</Telefon>
        </Telefons>
      </Row>
    </Rows>

    Then you can filter on "Pris"

    Hilary Stoupa

  • 12-13-2011 07:25 AM In reply to

    Re: Dropdown list items filtered by choice and Price from XML-file

    I changed my XML file, to look like this:

    <Row>

      <Telefon>Phone1</Telefon>
      <Pris>300</Pris>
      <Funktion>Brance Manager</Funktion>
      <Funktion>Controler</Funktion>
       </Row>
    - <Row>
      <Telefon>Phone2</Telefon>
      <Pris>250</Pris>
      <Funktion>Brance Manager</Funktion>
      <Funktion>Controler</Funktion>
      <Funktion>Disponent</Funktion>
        </Row>
    - <Row>
      <Telefon>Phone3</Telefon>
      <Pris>200</Pris>
      <Funktion>Brance Manager</Funktion>
      <Funktion>Controler</Funktion>
      <Funktion>Disponent</Funktion>
      <Funktion>Assistent</Funktion>
      </Row>
     
    So "Funktion" is the controling part, but when i use the XML file in a dropdown list, i need a filter, and only shows "Brance Manager" "Controler" "Disponent" and "Assisten" one time.
    Right now it show each "Funktion"  as many time as it is in the XML file.
     
    I have been looking on the web, and it look like use of "Expression" would solve this, but i don't know how to define the expression.
     
    Anyone that are able to help me with that?
  • 12-13-2011 08:07 AM In reply to

    Re: Dropdown list items filtered by choice and Price from XML-file

    In the drop down control's properties you have the option of displaying only unique values - although that may have been added in IP 2007 - what version are you using?

    If that option is not available (sorry, I can't remember whether it was available in IP 2003, but I'm suspecting not) you can use a preceding-sibling formula to filter out the values that are repeated.

    Hilary Stoupa

  • 12-14-2011 12:44 AM In reply to

    Re: Dropdown list items filtered by choice and Price from XML-file

    That did the trick Hilary.

    Thanks for your help. :)

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