Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5086 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I am trying to highlight a record in a portal where the portal record ID (departmentsFL::ID) = an ID in a global field list (VIEWER_vwr::highlight_g). The IDs are alpha-numeric. I used this:

PatternCount ( VIEWER_vwr::highlight_g ; departmentsFL::ID )

This is flawed because the ID DEP1 and DEP11 are both true for PatternCount(). How can I scan a list of text and check for unique text and numbers?

Thanks.

Posted

If VIEWER_vwr::highlight_g contains a list of values, then I think this is what you are looking for

not IsEmpty( FilterValues( VIEWER_vwr::highlight_g ; departmentsFL::ID ) )

Posted

As I was searching, I came across this

PatternCount ( "¶" & <Value List Items> & "¶" ; "¶" & <Search Value> & "¶" )

This works. Now, when I search for DEP11 in the list I find only DEP11 and not DEP1.

Why does this work? With the carriage returns, the PatternCount() returns 1. Without the carriage returns, it returns 2. Can anyone clarify/enlighten?

Thanks.

Posted

Thanks, comment and dansmith65. I didn't notice your comments until after my follow-up comment.

@dansmith65 - yes, that seems to do the trick. Thanks.

Posted

Can anyone clarify/enlighten?

Well, "DEP1" is contained in "DEP11". So:

PatternCount ( "DEP1¶DEP11" ; "DEP1" ) 

returns 2, because "DEP1DEP11" contains two occurrences of "DEP1".

Posted

Well, "DEP1" is contained in "DEP11". So:

PatternCount ( "DEP1¶DEP11" ; "DEP1" ) 

returns 2, because "DEP1DEP11" contains two occurrences of "DEP1".

Right, but why does adding a carriage returns to the beginning and end of the list as well as the beginning and end of the value change that?

Posted

Adding carriage returns to "DEP1" changes it to "¶DEP1¶". Neither "DEP11" nor "¶DEP11¶" contain the modified pattern.

You need to wrap the value list in carriage returns as well - otherwise the first and the last values in the list will not match the searched value.

Posted

Adding carriage returns to "DEP1" changes it to "¶DEP1¶". Neither "DEP11" nor "¶DEP11¶" contain the modified pattern.

And the lightbulb goes on. Thanks, comment. That makes sense.

This topic is 5086 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.