Populate Text Box from DDL - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Populate Text Box from DDL

Last post 05-14-2009 05:18 AM by venkatesh.suragana. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 11-04-2005 06:57 AM

    Populate Text Box from DDL

    I have a DDL and Text Box in a repeating section. The DDL is populated from a secondary data source, what I want to do is have the text box also populated from the secondary data source based on the DDL selection. Each selection in the DDL has an ID number that corresponds to it, which is what I want to appear in the text box after the DDL selection is made.

    If anyone has an answer it would be greatly appreciated.

    Thanks
    Smitty
  • 11-04-2005 08:45 AM In reply to

    Re: Populate Text Box from DDL

    Hi,

    The node in your schema behind the DDL is storing the ID that you are looking for (let's call it field1). So, if your textbox is bound to that same node (or that its default value point to field1 in case your need a separate node), the display will be the ID you are looking for.

    Does it make sense?

    Regards,

    Franck Dauché
  • 11-04-2005 01:17 PM In reply to

    Re: Populate Text Box from DDL

    Thanks Franck...I was able to figure it out. I created a rule on my Text Box and then edited the XPath. This was my final result.

    xdXDocument:GetDOM("IPF_Diagnosis")/dfs:myFields/dfs:dataFields/d:IPF_Diagnosis/@ICD9_Code[../@Description = current()/../my:DDL1]

    I had to edit "out" what was right after current().

    Thanks
    Smitty
  • 11-07-2005 10:55 PM In reply to

    Re: Populate Text Box from DDL

    Hey Smitty, I am trying to do the same thing. Could you post what your original rule looked like and then what your edit was. I just can't seem to figure this on out.

    Thanks
  • 11-15-2005 08:54 AM In reply to

    Re: Populate Text Box from DDL

    Sorry for the late response...here is the correct line of code followed by what is given to you by default.

    xdXDocument:GetDOM("Referral")/dfs:myFields/dfs:dataFields/d:Referral/@Address_Line_1[../@Last_Name = current()/../@Last_Name]


    xdXDocument:GetDOM("Referral")/dfs:myFields/dfs:dataFields/d:Referral/@Address_Line_1[../@Last_Name = current()xdXDocument:get-DOM()/dfs:myFields/dfs:dataFields/d:Account/d:Provider/@Address_Line_1

    You need to click the XPath check box in the Insert Formula dialog box and manually edit out - xdXDocument:get-DOM()/dfs:myFields/dfs:dataFields/d:Account/d:Provider - and replace it with - /.. - in order for it to work.

    The following are the exact steps I took to get this.
    1. Go to Rules in the DDL.
    2. Click Add Action button.
    3. Select "Set a field's value" from the drop down.
    4. Click the button Right of the Field text box and select the field you want populated.
    5. Click the button Right of the Value text box.
    6. Click the Insert Field button and select the field from the Secondary data connection you want the value to come from.
    7. Click Filter Data and Click Add in the Filter Data window.
    8. From the 1st Drop Down select the Field or Group.
    9. Select the field from the secondary data source that populates you form's DDL.
    10. Leave the middle drop down at "is equal to".
    11. Select Use Formula in the 3rd drop down.
    12. Type current() in the Insert Formula.
    13. Click Insert Field and select your DDL from the Main Data Source.
    14. Check the XPath check box and edit out as above.
    15. Click Verify Formula to test.
    16. Click OK 15 thousand times to get out.

    Hope this helps...It was a fun brick wall to bash through.

    Smitty
  • 11-15-2005 10:37 PM In reply to

    Re: Populate Text Box from DDL

    15 thousand eh... :) LOL

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 05-14-2009 05:18 AM In reply to

    Re: Populate Text Box from DDL

     

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