Value not updating from the secondary data source. - InfoPath Dev
in

InfoPath Dev

Having trouble finding a blog or post that answers your question? Check out our Custom Search Page

Value not updating from the secondary data source.

Last post 09-28-2012 09:46 AM by infopath_newbee. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 09-24-2012 05:41 PM

    Value not updating from the secondary data source.

    hi, 

    I have created a drop down list.  I have created a secondary data source based on the XML file. The file has supplier name (Column1), supplier number(Column2) and address ID (Column3). The drop down lists display value is "Column1" of the XML file. The value for the drop down list is "Column2" of the XML file. I have a text filed(AddressID) , which I want to populate with the corresponding "Column3" value from the XML file. Now the drop down works fine. in the drop down's rule I have defined a new rule . The "Action" is defined as "set a field' value" , in the field, I selected the "AddressID" and  in the value, I have selected the "Column3
     from the secondary data source ( which is the XML file) . Now when I preview the form, and I change the Supplier  drop down list, the "AddressId" value is getting set to the first record's column3 value which is "40715". No matter which supplier I choose from the drop down , the "AddressID" does not change. Any suggestions ?

    Thanks 

     here is a portion of XML file ( secondary data source)

    <Row>
            <Column1>5 Prime 3 Prime</Column1>
            <Column2>25715-0</Column2>
            <Column3>40715</Column3>
     </Row>

    <Row>
            <Column1>A-1 Textiles &amp; Hospitality Prod</Column1>
            <Column2>25961-0</Column2>
            <Column3>40961</Column3>
    </Row>

  • 09-25-2012 06:00 AM In reply to

    Re: Value not updating from the secondary data source.

    Hi

    You just need a rule and the correct filter. Here's a sample. Hope it helps

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 09-25-2012 03:26 PM In reply to

    Re: Value not updating from the secondary data source.

     Hi Ernest,

    Thanks for your reply. I tired to do the same in my form, but when I try to select the field , it puts a "." instead of   the field name .

    So its becoming like 

    Column3[Column2 = .]

    rather than 

    Column3[Column2 = field1]

    even on your sample form , the value changes like shown above and your form stops functioning. So How do I put the filed name rather than the "." . My info path is 2007 .  Any suggestions ?

    Thanks 

     

  • 09-25-2012 09:15 PM In reply to

    Re: Value not updating from the secondary data source.

    infopath_newbee:
    Column3[Column2 = .]
     

    This is a funny guessing game... I cannot even find how to reproduce this expression (with dot)
    Could you attach your template?

    Gennady Vanin (Novosibirsk) --- Геннадий Ванин (Новосибирск)
  • 09-26-2012 02:34 PM In reply to

    Re: Value not updating from the secondary data source.

     Hi Gennady Vanin,

    I have attached the screenshot. I will be attaching the actual file , if you click on the rules of the field "field1" you will see  it.But the image has few screen shots to explain it

    Thanks 


  • 09-26-2012 02:36 PM In reply to

    Re: Value not updating from the secondary data source.

     Hi Gennady Vanin,

    I have attached the file in this post. Please see the attachment.

    Thanks 

  • 09-26-2012 10:43 PM In reply to

    Re: Value not updating from the secondary data source.

    I see that your filter contains expression

    the rationale of which is blurred for me

    In your Rule Details ,  press fx > double-click on your formula expression > Filter Data.. > Modify... >

    • in the left dropdown choose Column2 (instead The expression)
    • in the right dropdown (after is equal to) choose Select a field or group...

     

    and then, having changed to Main  data source, select field1 and press OK few times

    Run (F5) and it should work

     

    PS (ramblings):

    You should put into textbox field2 (linked to data fiels field2 of Main Data Source) the value of Column3 element ( from dropdown field1's linked to  secondary data source or embedded XML file), so that its Column2 value is equal to Value: from field1 of Main data source

    Dropdown List Box Properties (Gennady Vanin)


    So, having chosen field1, you create a rule of type action, Run these actions:,
    Action:Set a field's value
    Field: field2 (textbox in Main Data Source)
    Value: press fx > Insert Field or Group... > choose secondary data source sample (Secondary) > choose Column3 > press Filter Data... > Add.. >

    on the left dropdown  choose Column2
    on the right dropdown of Filter Data Dialog (of Insert Formula), press Select a field or Group... and choose field1
     

    Gennady Vanin (Novosibirsk) --- Геннадий Ванин (Новосибирск)
  • 09-28-2012 09:46 AM In reply to

    Re: Value not updating from the secondary data source.

    Hi  Gennady,

    Thank you so much. It works like a charm.

    Thanks Again.

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