Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

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

Posted

Hi

quotes can be escaped like you said ( " ), single quote do not need an escape char.

So this has to work:

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

Posted

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

Posted

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. :)

Posted (edited)

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
Posted

Michael

Yes I just read as much -

Is there a way of doing a search and replace for the curly quotes?

there aren't too many records about 4000 or so - but its enough to want to automate a replacement routine if I can

thanks

Simon

Posted

just found this from Fabrice Nordmann...in a similar thread

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

so will have a go...

Posted

You can do this by showing all records and doing Replace Field Contents… with a calculated result, using the Substitute() function. Be sure to backup your data before trying this, though.

Posted

_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.

Posted

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

Yes, every not empty or not zero values are considered true.

Posted (edited)

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
Posted

Maybe - it depends. I would clean up the data after turning off smart quotes anyway.

In any case, the "smart" double quotation marks need to be escaped, too.

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