QRules insert and "before"/"posn". - InfoPath Dev
in

InfoPath Dev

QRules insert and "before"/"posn".

Last post 01-06-2012 12:05 PM by shniggens. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 12-15-2011 01:12 PM

    QRules insert and "before"/"posn".

    Alright, this is a tough one.

    I have a repeating table that gets populated by a "CopyTable" command.  There are two drop downs that get concatenated to filter the data that gets copied in.  This concatenated field exists inside the table and outside of the table for comparison purposes.   Basically the table gets populated in batches, depending on two values that the user selects. 

    The table only displays info that matches what the two drop-downs are currectly selected (matches a concatenated field, basically).  So even if the data has been pulled in already, the table view will change depending on what the user selects in the drop down.

    I want an "add custom item" button that inserts a blank row for users to fill out.  BUT, I need to be inserted at the top of the ACTIVE view, or at the beginning of the category that is currently selected.

    Keep in mind that it is really one field in the table that determines the new category .. . it's a concatenation of the two drop downs.

    Any idea how I can accomplish this?

  • 12-16-2011 05:29 AM In reply to

    Re: QRules insert and "before"/"posn".

    Hello shniggens,

    Would it be able to just insert the new row at the beginning of the whole repeating group, and use a filtered SetValue command to set the requisite category field appropriately?  That way it would definitely appear at the top.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-16-2011 08:05 AM In reply to

    Re: QRules insert and "before"/"posn".

    I'm already doing that, so that it appears when filtered in the correct category.  But my entire table is ordered by category.  So when I pull in the first batch it's rows 1- 30.  When I pull in the second batch it's 31 -50.  Etc.  When I add a custom row to the second batch, I would like it to appear at row 31.  

  • 01-05-2012 09:45 AM In reply to

    Re: QRules insert and "before"/"posn".

    The reason I need it inserted into the correct "batch" is I have some preceeding-sibling filtering going on with the category field.  They need to be adjacent.  Any other ideas?

  • 01-06-2012 08:51 AM In reply to

    Re: QRules insert and "before"/"posn".

    OK . . . is there a way to count the rows up to an instance of a certain field.  For instance, count how many rows exist before the category field contains a certain string, and then insert before that?

  • 01-06-2012 09:59 AM In reply to

    Re: QRules insert and "before"/"posn".

    Well, it's probably easier than that.  Just use a /before parameter that filters on category and you should have it just where you want it:

        /before=my:repeatingField[my:Category = 'value']

    The only issue here is that this will fail if there are not yet any rows with that category name, so you will probably need to have some logic that inserts the new item at the very beginning or end of the list if that's the case.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 01-06-2012 11:17 AM In reply to

    Re: QRules insert and "before"/"posn".

    That's a step in the right direction.  I need to insert it before a field in the table that matches a field outside the table. 

    I tried this formula - concat("Insert /parent=/my:myFields/my:Pullsheet /child=my:PullSheet /before=", GearVenueConcat, "[", GearVenueConcat, "=", VenueGearConcat, "]")

    Where GearVenueConcat is within my table, and VenueGearConcat is outside my table.  That didn't work.

    I also tried - Insert /parent=/my:myFields/my:Pullsheet /child=my:PullSheet /before=my:GearVenueConcat[my:GearVenueConcat = my:VenueGearConcat]

    Apparantly that didn't find it, because it added it to the last row. 

     

  • 01-06-2012 11:29 AM In reply to

    Re: QRules insert and "before"/"posn".

    Here's the two xpaths I want to match -

     /my:myFields/my:Pullsheet/my:VenueGearConcat

    /my:myFields/my:Pullsheet/my:PullSheet/my:GearVenueConcat

  • 01-06-2012 11:31 AM In reply to

    Re: QRules insert and "before"/"posn".

    shniggens:
    Insert /parent=/my:myFields/my:Pullsheet /child=my:PullSheet /before=my:GearVenueConcat[my:GearVenueConcat = my:VenueGearConcat]

    Instead of the above, try: concat("Insert /parent=/my:myFields/my:Pullsheet /child=my:PullSheet /before=my:GearVenueConcat[my:GearVenueConcat = '", my:VenueGearConcat,"']")

    Selecting my:VenueGearConcat using the field picker - you want the result of the concat formula to resemble Jimmy's sample.

    Hilary Stoupa

  • 01-06-2012 11:36 AM In reply to

    Re: QRules insert and "before"/"posn".

    And that wasn't quite right either, sorry:

    concat("Insert /parent=/my:myFields/my:Pullsheet /child=my:PullSheet /before=my:PullSheet[my:GearVenueConcat = '", my:VenueGearConcat,"']")

    Hilary Stoupa

  • 01-06-2012 12:05 PM In reply to

    Re: QRules insert and "before"/"posn".

    That did the trick! Thanks!
Page 1 of 1 (11 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.