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

Filter with inverted commas


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

Recommended Posts

Hi all - having a trouble with the following:

I want to conditionally format a field based on:

[if] length (filter ( mytextfield ; " !£") > 0 then format background yellow etc

But I also want to filter out inverted commas (" and ') from mytextfield

I am going round in circles looking at escaping with "" and the quote function...none of which seems to have the desired result

Any help grateuflly recd

thanks

Simon

for reference mytextfield is an e-mail address and I want to highlight the field if its got disallowed characters, what I have at the moment is :)

Length ( Filter ( Self ; " *,%<>!?[]{}£^&()/|~#") ) > 0

Link to comment
Share on other sites

Hi Daniele

Have pasted exactly as you put back into field so that I have

Length ( Filter ( Self ; " *,%<>!?[]{}£^&()/|~#'"") ) >0

It correctly formats the email address field except if it has a ' or " and then it doesn't apply the condidtional formatting

Any suggestions

Thanks

Simon

Link to comment
Share on other sites

Have pasted exactly as you put back into field so that I have

Length ( Filter ( Self ; " *,%<>!?[]{}£^&()/|~#'"") ) >0

BTW: you didn't paste exactly my calc...

It was w/o the "> 0" part and will work the same way of your. :)

Link to comment
Share on other sites

Ok I have removed the ">0" and as you say it does work

but I have to admit to not understanding why?

- is the fact that it resolves to a number sufficient to make it true?

if the filter(self,chars)resulted in an empty string would the length of that string be 0 or null? and does that make any difference to a conditional test?

would like to know

cheers

simon

Edited by Guest
Link to comment
Share on other sites

_str = Substitute ( string ; [ "“" ; """ ] ; [ "”" ; """ ] ; [ "" " ; """ ] ; [ "" " ; """ ] )

That doesn't look right. IMHO, it needs to be:


Substitute ( string ; 

[ "“" ; """ ] ; 

[ "”" ; """ ] ; 

[ "‘" ; "'" ] ; 

[ "’" ; "'" ] 

)

I am not sure how much of that is visible here, but it's:

• left double quotation mark to quotation mark;

• right double quotation mark to quotation mark;

• left single quotation mark to apostrophe;

• right single quotation mark to apostrophe.

Link to comment
Share on other sites

Isn't simpler to add those chars into the initial calculation ?

Length ( Filter ( Self ; " *[color:red]“”,[color:red]‘’%<>!?[]{}£^&()/|~#'"") )

Edited by Guest
Edit: comment's note
Link to comment
Share on other sites

This topic is 5764 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.