AnsweredAssumed Answered

PatternCount() function  Possible bug

Question asked by BruceHerbach on Mar 28, 2013
Latest reply on Mar 31, 2013 by BowdenData

I'm trying to look for an ID in a variable containing a list of record IDs. All of the IDs are UUIDs created with the get(UUID) function. So they look like 87199D05-ACB2-479F-BD5B-13F98162206F with the - character. With the - character in the string Patterncount fails to find a matching ID. If I use the substitute function and remove the - character from the values in the variable list and from the value I am comparing, Patterncount finds the matching value.

 

Has anyone else seen this? Should I report it as a bug?

---------

The original script ( one that fails ) looks like this:

 

Set Variable[$IDlst; List($IDlst; table::ID)]

.

.

if[patterncount($IDlst; $newID) = 0]

new record

set field...

end if

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

The functioning version added substitute so it looks like:

 

Set Variable[$IDlst; List($IDlst; substitute(table::ID; "-'; ""))]

.

.

if[patterncount($IDlst; substitute($newID; "-"; "")) = 0]

new record

set field...

end if

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

Thanks

Bruce

Outcomes