Filtering text boxes in Repeating Section - InfoPath Dev
in

InfoPath Dev

Filtering text boxes in Repeating Section

Last post 05-24-2006 01:06 PM by Matt Faus. 16 replies.
Page 1 of 2 (17 items) 1 2 Next >
Sort Posts: Previous Next
  • 05-15-2006 01:34 PM

    Filtering text boxes in Repeating Section

    Hello All,

    I'm new to infopath forms and I have a form that works fine except one last problem I can't resolve.

    I have a repeating section with a ddl that is filtered based on the values in a textbox in another part of my form. That works fine, but where I'm having trouble is in the repeating section I have several text boxes that are populated based on the value in the ddl. This works except when the user adds an additional section - the text boxes in the new section look at the value in the ddl in the original section and I need them to look at the value in the section that they're in. Can anyone explain to me how to use the current() function in this situation?

    Thanks for any help in advance.

    Chris [/font=Arial]
  • 05-17-2006 10:20 AM In reply to

    Re: Filtering text boxes in Repeating Section

    Hi Chris and welcome to the forum!

    A cool trick I've used before is that on whatever node you are trying to use current() on add a rule that pops a dialog box with this formula: local-name(current()). This will tell you exactly what node current() is refenching, then from there you can create an XPath like this:

    current()/../my:SiblingField

    Or whatever else you need to access the node you're looking for!

    I hope this helps!
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 05-17-2006 02:45 PM In reply to

    Re: Filtering text boxes in Repeating Section

    Hey Matt:

    Thanks for the response! I'm having a little trouble understanding what to do with the instructions - newby here. I've tried it a few (many) times and can't seem to get what you described to work. Could you explain in a little more detail - hopefully geared toward a non-IT person?

    Thanks again!

    Chris
  • 05-17-2006 09:06 PM In reply to

    Re: Filtering text boxes in Repeating Section

    1. On the view, double-click your ddl, and then click Rules.
    2. Click Add, and then click Add Action.
    3. Choose "Display formula in dialog box".
    4. Click the Fx button, check the "Edit Xpath" box, and insert local-name(current())
    5. Click OK on all of the dialog boxes.
    6. Preview the form and make a selection on the ddl. A dialog should pop up with whatever value current() is retrieving.
    7. Close preview mode and open the Data Source task pane.
    8. Determine the correct path from the node that was displayed as the value of current() to the node that you are trying to reference.
    9. Use this path to set up filtering.

    Example Schema:

    Group
    --RepeatingGroup
    ----FilterField
    ----MiscField
    ----DDL

    If current() displays "DDL" your path to the filter field will be current()/../FilterField. This means from DDL go up to the parent, and then down to FilterField.

    If current() displays "RepeatingGroup" your path to the filter field will be current()/FilterField.

    I hope this clears things up!
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 05-19-2006 12:49 PM In reply to

    Re: Filtering text boxes in Repeating Section

    Hi Matt:

    Still having trouble with this. This is my filter where ProjectCommonTitle is the ddl located in the repeating section and Project_TaskID is the text field in my secondary data source.

    This is the filter in the Project_ID field in my main data source.
    @Project_TaskID[@Common_Title = current()/ProjectCommonTitleCI]

    Can you tell me what I'm doing wrong?

    Thanks for your help

    Chris in Dallas
  • 05-21-2006 05:24 PM In reply to

    Re: Filtering text boxes in Repeating Section

    I would have to know a little bit more about your schema to give you exact advice, but I think you might want to add a ../ in there:

    @Project_TaskID[../@Common_Title = current()/ProjectCommonTitleCI]

    If this doesn't work, try this:

    @Project_TaskID[../@Common_Title = current()]
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 05-23-2006 11:45 AM In reply to

    • Adub21
    • Not Ranked
    • Joined on 05-18-2006
    • USA
    • Posts 25

    Re: Filtering text boxes in Repeating Section

    Hi Matt. I have a question similar to this and I've been working on this all day and haven't been able to figure it out.

    I have a form that has a drop down list for Customer and a drop down list for all the projects that correlate to each customer. I also have other fields for Project Manager and associated information.

    When a user comes into the form, they should be able to click on a customer, get the projects that are associated with that customer and then the form will populate the Project manager (and corresponding fields) based on the project selected.

    This is set up to use a SQL database. There is a data connection to the Customers table and then there is a secondary data connection to a joined table where it takes the corresponding projects for each customer goes out to the employee table to get the name of the project manager for each project.

    I have tried numerious ways to try and get this to work. Any thoughts?
  • 05-23-2006 12:32 PM In reply to

    Re: Filtering text boxes in Repeating Section

    Glad to see I'm not the only one Adub21 lol! I'm still having trouble with this but I've learned a lot about XPATH along the way.

    Now that I know more I'm going to try to explain my situation a little better.
    Here's my Schema:
    • my:SMARTool(repeating group)

    • my:Section1-A_CI(repeating group)

    • ProjectCommonTitleCI (DDL - Access database is secondary datasource)this is filtered based on the selection in another DDL Department - once a department is selected all the projects for that department populate this ddl.

    • ProjectNumberCI (textbox - Access database is secondary datasource this # should correspond to the ProjectCommonTitleCI)

    • ProjectDescriptionCI - (textbox Access database is secondary datasource this should correspond to the ProjectCommonTitleCI)


    I use a filter for both @ProjectID or @Project_Description[@Common_Title = ProjectCommonTitleCI]

    I need to get the two textboxes to look at the current value in the DDL and return corresponding values from the record in the Access database. It's not a problem on the first repeating section but in subsequent sections the textboxes will allow me to input different values as long as they precede the value in the DDL in the first section.

    This is weird so I'll try to demonstrate it.

    1st Repeating section (this is the behavior that I want)
    DDL = 5
    Filtered TB1 = 5
    Filtered TB2 = 5

    2nd Repeating section (this works as long as the value precedes the first value)
    DDL = 4
    Filtered TB1 = 4
    Filtered TB2 = 4

    3rd Repeating section (here's the problem)
    DDL = 6
    Filtered TB1 = 5
    Filtered TB2 = 5

    I've tried every configuration of current() that you've (Matt) suggested and looked at other message boards. HELP! I have a presentation in a few days and really need to work this out.
  • 05-23-2006 02:43 PM In reply to

    Re: Filtering text boxes in Repeating Section

    Please post all of your XPath filters so I can help debug.

    This can get kind of complicated sometimes so it's rather hard without knowing your schema. If you want to take a screenshot of the data source task pane, that would also be helpful.
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 05-24-2006 05:30 AM In reply to

    • Adub21
    • Not Ranked
    • Joined on 05-18-2006
    • USA
    • Posts 25

    Re: Filtering text boxes in Repeating Section

    Hi Matt.

    What do you mean by xpath filters? I'm not sure how to attach a screen shot in here but i'll try to show you what I have:

    Customer _______drop down list going against Customer DB (SQL_Server)

    Project ________drop down of all projects for that customer - going against project database

    Project Manager _____ Text box that should fill in the information for that specific project -- the data needs to link to the Employee data base to get the name. The Project managers initials are in the Project Table for that project that was selected.

    Does info path not retain the current records in memeory? In other words, when the project field is selected, I have a rule set up (in the projects drop down list) to fill in the project manager but it's not filling it in.

    Please let me know if there is anything else I can do to help explain my form.

    Thanks!!
  • 05-24-2006 11:55 AM In reply to

    Re: Filtering text boxes in Repeating Section

    Matt:

    I couldn't figure out how to attach a photo so I saved them to my picture folder on yahoo. Hope you can follow this link. The remaining are my XPATH filters.

    http://pg.photos.yahoo.com/ph/chrisdaugherty1960/album?.dir=87b7re2&.src=ph&store=&prodid=&.done=http%
    3a//pg.photos.yahoo.com/ph//my_photos/

    DDL - dfs:myFields/dfs:dataFields/d:tblSMARToolData2/@Common_Title[../@Department = xdXDocument:get-DOM()/my:myFields/my:ListBoxGroup/my:listBox1 and ../@Activity_Type = "Change Initiative"]

    Textbox 1 - xdXDocument:GetDOM("SMARToolData2")/dfs:myFields/dfs:dataFields/d:tblSMARToolData2/@Project_TaskID[../@Common_Title = xdXDocument:get-DOM()/my:myFields/my:SMARTool/my:Section1-A_CI/my:ProjectCommonTitleCI]

    Textbox 2 - xdXDocument:GetDOM("SMARToolData2")/dfs:myFields/dfs:dataFields/d:tblSMARToolData2/@Change_Initiative_Completion_Quarter[../@Common_Title = xdXDocument:get-DOM()/my:myFields/my:SMARTool/my:Section1-A_CI/my:ProjectCommonTitleCI]
  • 05-24-2006 12:04 PM In reply to

    • Adub21
    • Not Ranked
    • Joined on 05-18-2006
    • USA
    • Posts 25

    Re: Filtering text boxes in Repeating Section

    Is it just me or does this seem really complicated? I don't understand how using two data sources in one form can be such a hard task. :-)

    Matt,

    I just read that you can't update a secondary data source. The next part of the form that I'm going to have to do is going to update a different data source. Can I use seperate views to update another data source instead then? I realize we're both already bombarding you so feel free to not answer this for a while. :-)


    At least we have a holiday weekend coming up!!!
  • 05-24-2006 12:36 PM In reply to

    • Adub21
    • Not Ranked
    • Joined on 05-18-2006
    • USA
    • Posts 25

    Re: Filtering text boxes in Repeating Section

    One more note, I don't have a repeating table, I have two drop down lists and a text box. Maybe that's my problem?
  • 05-24-2006 12:41 PM In reply to

    Re: Filtering text boxes in Repeating Section

    Chris,
    I tried to check out your images, but they were too small for me to decipher anything about the schema.

    Angie,
    You should be able to update a secondary data source - what exactly do you mean? You can use seperate views pretty much any time, yes.

    ------------

    I think we're starting to run into communication breakdowns due to the limitations of our medium, this forum. If you want to setup some phone/Live Meeting support (for a small fee) to get everything worked out, you should e-mail Patrick Halstead.
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 05-24-2006 12:57 PM In reply to

    Re: Filtering text boxes in Repeating Section

    Matt:

    I uploaded new images that are easier to read.

    http://pg.photos.yahoo.com/ph/chrisdaugherty1960/album?.dir=87b7re2&.src=ph
Page 1 of 2 (17 items) 1 2 Next >
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.