Split up a text box based on a delimiter in a repeating table - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Split up a text box based on a delimiter in a repeating table

Last post 10-05-2018 08:23 AM by Hilary Stoupa. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 09-22-2018 08:00 PM

    Split up a text box based on a delimiter in a repeating table

    I have a field that will have values separated by a comma. i.e 1/1,2/2,3/3 I need to be able to take each of these values and place them in a repeating table so that i can run validation on each of them. A
  • 09-28-2018 07:51 AM In reply to

    Re: Split up a text box based on a delimiter in a repeating table

    You'll need code (or qRules) for this - there is nothing out of the box to add rows to a repeating table. But if all you need is validation, you might be able to do that with a custom pattern - can you provide more info on what a valid set of values might look like?
    Hilary Stoupa

  • 10-04-2018 05:16 PM In reply to

    Re: Split up a text box based on a delimiter in a repeating table

    Hi Hilary. I have Qrules already FYI. I really just need validation. I have tried regex but cant seem to get it 100 percent correct. So the possible values are as follows: 1-48 example: 1,2,3-10,15-20 the same is valid if you do it this way 1,2,3,4,5,6,7,8,9,10,15,16,17,18,19,20 and 1/1-48 2/1-48 3/1-48 and 4/1-48 a comma is a delimited and the dashes provide a way to do shortcuts. So as an example 1/1-10,2/1,2/2-10,4/1-48 is valid In short this is a form for a ethernet switch generator which can have up to 4 switches of 48 ports each. The problem with the regex is that I could not find a way to figure out duplicates i.e 1/1,1/1 or 1/1,1/1-4, 1/3 which clearly has 1/1 as a dup and 1/3 as a dup as well. My thinking was to figure out a way to translate user input as follows: 1/1-10 and translate that in to 1/1,1/2,1/3,1/4,1/5,1/6,1/7,1/8,1/9,1/10 and thus if i translate this only then will i be able to effectively do a regex for validation. I hope I explained this clear enough.
  • 10-05-2018 08:23 AM In reply to

    Re: Split up a text box based on a delimiter in a repeating table

    Yuck. That is a sticky one. I mean, I'd guess you could use an XSLT and the qRules transform command to create your repeating table - then you would be able to look for overlap (like if they put in 1/1-10, 1/1, 1/2 for example) - I think the XSLT would have to be rather complex to create a node for each item in a range .... but given all the various ways data can be entered, I'm not sure how many other options you have.
    Hilary Stoupa

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