Repeating Table Lookup Only Queries First Row for Secondary Data Lookup - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Repeating Table Lookup Only Queries First Row for Secondary Data Lookup

Last post 12-15-2022 03:55 PM by Hilary Stoupa. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 12-14-2022 02:54 PM

    Repeating Table Lookup Only Queries First Row for Secondary Data Lookup

    So I am a newbie at Infopath, so my skill level is base level compared to some of the postings I have seen here you guys are wizards so I will explain as best I can. I have a billing sheet that is grouped by a Date field broken down into repeating tables for Personnel, Equipment, Services, Materials, Subcontractors, and Additional Fees. So far as the the repeating tables for everything except Personnel, the rules I have applied function just fine. It is when I attempt some mental gymnastics in the Personnel group that stuff goes sideways. Personnel rates are not mathematical calculated values, they are looked up from an external SharePoint list based on the Position field AND RateTier fields. For the most part it functions fine if you select the Rate Tier pertinent to the billing sheet and then choose the Position values from the drop down. It's when you attempt to change the RateTier value that it grabs the first row in the Personnel grouping and duplicates the value for the other Position rows. It will change if you adjust the Positions after setting the RateTier again, but I want it to simply update the values for the rates without having to do this extra step. I have been beating my head against the wall trying to figure this out since it's really the last piece to the puzzle that I need to figure out. Is there a trick to getting it to query for each row? Do I need to set the Position field a level above the rates?
  • 12-14-2022 05:01 PM In reply to

    Re: Repeating Table Lookup Only Queries First Row for Secondary Data Lookup

    Any chance I could see a copy of your form? It makes it so much easier for me to help you - you can attach it under a reply in the options tab. My guess is that you may have a default value in Position and might want to be using a rule instead....
    Hilary Stoupa

  • 12-15-2022 07:36 AM In reply to

    Re: Repeating Table Lookup Only Queries First Row for Secondary Data Lookup

    Sure thing, just give me a moment. It's been a while since I have been on a forum. Should be attached or so I hope.
  • 12-15-2022 08:53 AM In reply to

    Re: Repeating Table Lookup Only Queries First Row for Secondary Data Lookup

    Hey, I think you have a structural issue here to start with. You have a repeating group of Personnel, with another repeating group inside it of PersonnelDetails. Is that intentional? Is this form being used yet, or still in development? I think it would be best to start by fixing this schema.... Do you see how the controls in that repeating table have a warning about the control not being able to store the data correctly? I think the fields in PersonnelDetails need to be moved to Personnel and the repeating PersonnelDetails group removed from the schema. Then the controls can be rebound.
    Hilary Stoupa

  • 12-15-2022 09:37 AM In reply to

    Re: Repeating Table Lookup Only Queries First Row for Secondary Data Lookup

    Rookie mistake I hope. It is in development at this time. The groups were likely an error on my part, not understanding the structure of it. The idea is to have the Date be a grouping for the individual billable types, prices dependent on the rate tier that they are in. I went ahead and made the change as you suggested. I'll let you know what I figure out.
  • 12-15-2022 11:42 AM In reply to

    Re: Repeating Table Lookup Only Queries First Row for Secondary Data Lookup

    @Hilary, I did as you suggested, however still receiving the same issue. I have attached the updated version of the file. I have set a rule for the TierRate field and the Position field that should RateTier equal a specific value that it sets a query field for Position in the external Sharepoint List that is pulled from and runs a query for that Position, it then matches the RTRate and OTRates for the specific Position and clears the query. This works fine when the TierRate is selected prior to the Position, however once positions are set, if you change the TierRate, it overrides all the values of the RTRate and OTRate fields with the first rows values. Ideally this would update the values based on the tier that is selected.
  • 12-15-2022 11:59 AM In reply to

    Re: Repeating Table Lookup Only Queries First Row for Secondary Data Lookup

    Great - I'll take a look later today and let you know what I learn :)
    Hilary Stoupa

  • 12-15-2022 12:51 PM In reply to

    Re: Repeating Table Lookup Only Queries First Row for Secondary Data Lookup

    Ah, I see what you are talking about now. So - the RateTier field is outside of the repeating element where you are setting values. This means that it will set every single value the same, as you've seen. I usually just use a helper field for something like this - and I also think your logic could be simplified. It looks like you need all the data from that secondary data connection, so probably no need for all this querying and requerying. :) I think there are still issues on this copy with the Position field and RateTier field. Both of those have a rule called "On Change" that are going to set all instances of EquipRate and ServRate to the same values, because Position and RateTier are not inside the same repeating groups. You may be able to get away with a helper field here to - similar to what I've done on the new attribute in the Personnel repeating group. Right click the linked form and use Save as to save locally. Right click the locally saved template and select Design to open in InfoPath Designer....
    Hilary Stoupa

  • 12-15-2022 02:09 PM In reply to

    Re: Repeating Table Lookup Only Queries First Row for Secondary Data Lookup

    Thank you for that I am looking at it presently. So trying to follow the logic a bit and now I understand what you mean by the values of the equipment and service line items being the same as well. - Do the rules process in order with the initial rule being the initial trigger? I see the helper field you mentioned and see that it does indeed reflect the changes when the RateTier field changes. just trying to understand the process flow since I am very new to this. -- Thank you for you help it is very much appreciated.
  • 12-15-2022 03:55 PM In reply to

    Re: Repeating Table Lookup Only Queries First Row for Secondary Data Lookup

    So - basically, if your rules are running inside the repeating element, they will only set the value of their siblings (i.e. the fields in the same repeating group). So - by setting that helper field, it will then set values only for its own row. Not for any other row. Otherwise when you set the RateTier, outside of the repeating group, all instances in the repeating group will be set to the same value, as you've found. Now the On Change rule you have probably also needs to be set up the same way - so that a helper field inside each repeating group is only set to update it's own siblings... Does that make sense?
    Hilary Stoupa

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