Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Hi all

Is there a calculation to remove all long text strings (say anything over 20 characters) from text fields?

Thanks

How about:

Left ( YourField ; 20 )

 

  • Author

The string(s) could appear anywhere within the field. I'm trying to clean up emails where there's lots of strings from hyperlinks that are in the signatures (usually from the email signature).

Then I am afraid I don't understand what you mean by "string". Wy don't you provide an example or two of what's in the field and what you would like to see as the result.

  • Author

Emails are retrieved as records. And the body of the email might contain something like this:

Click this link to unsubscribe from this email: https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmypcsecurity.webrootanywhere.com%2Funsubscribe.aspx%3FT%3Dasdffsdf34228e3b-77d9-4eb2-8132-778fd4dea454%26UEM%3Dsupport%40madso.uk&data=02%7C01%[email protected]%7Casd29c4c0901c808d673d792d0%7C7a80fada51274aa9aaedca692e314d1d%7C1%xxx68237670672dddata=0YhXOxZRHF6%2Fls6fY%2BA4za%2BvsGo6dPBtWMQhVQZo%2ByE%3D&reserved=0

It's these long strings of text that I would like to remove as they make reading emails difficult (especially when there are multiple emails contacenated). But there are so many different ones that I can only think to do a search by length, rather than a specific substitute calculation.

Edited by sal88

This is not going to be simple, because Filemaker can divide text only to paragraphs (values) and words. In your example, the substring:

https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmypcsecurity.webrootanywhere.com%2Funsubscribe.aspx%3FT%3Dasdffsdf34228e3b-77d9-4eb2-8132-778fd4dea454%26UEM%3Dsupport%40madso.uk&data=02%7C01%[email protected]%7Casd29c4c0901c808d673d792d0%7C7a80fada51274aa9aaedca692e314d1d%7C1%xxx68237670672dddata=0YhXOxZRHF6%2Fls6fY%2BA4za%2BvsGo6dPBtWMQhVQZo%2ByE%3D&reserved=0

is actually 32 separate words, the way Filemaker sees it. So you need to make up your own division - probably by looking for spaces and returns as the only separators to consider.

And of course, this must be a recursive process, taking each "token" in turn and examining it for length. 

In the attached demo, I used a looping script (with 2 loops, one for paragraphs and one for tokens separated by spaces). To make this a calculation, you would need to replicate the same logic using a custom function (or functions).

ShortenLongStrings.fmp12

14 hours ago, sal88 said:

Emails are retrieved as records. And the body of the email might contain something like this:

Click this link to unsubscribe from this email: https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmypcsecurity.webrootanywhere.com%2Funsubscribe.aspx%3FT%3Dasdffsdf34228e3b-77d9-4eb2-8132-778fd4dea454%26UEM%3Dsupport%40madso.uk&data=02%7C01%[email protected]%7Casd29c4c0901c808d673d792d0%7C7a80fada51274aa9aaedca692e314d1d%7C1%xxx68237670672dddata=0YhXOxZRHF6%2Fls6fY%2BA4za%2BvsGo6dPBtWMQhVQZo%2ByE%3D&reserved=0

It's these long strings of text that I would like to remove as they make reading emails difficult (especially when there are multiple emails contacenated). But there are so many different ones that I can only think to do a search by length, rather than a specific substitute calculation.

Maybe display these emails in a webviewer so that the html code gets displayed properly? I did a google on removing urls form emails and got a lot of responses that had negative results from this. Apparently not as easy to do as it has a tendency to break a lot in the emails.

  • 3 weeks later...
  • Author

Thanks guys! I'll be exploring both options. I guess the new While function will be handy for comment's trimming option too.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.