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.

Finding whatever the Trim function does not find

Featured Replies

Hi,

Suposse you have a field with the following code in the Calculated value > Auto-enter dialog:

Let ( [

    //define variables:



Filtered_Text = Filter (VAT; "0123456789ABCDEFGHIJKLMNÑOPQRSTUVWXYZabcdefghijklmnñopqrstuvwxyz") ;

length_Text = Length (Text);

length_VAT = Length (VAT);

Not_filtered_Text = ?



error = If ( length_Text  ≠  length_VAT ; "The content of the field would be automatically corrected. Please do not use the following characters: " & ? ; "")



];



    If ( error ≠  ""; error; Filtered_Text

    

I would like the value of Not_filtered_Text to be equal to whatever characters have not been filtered(carriage return, backslash, dash, etc.). I would like them to appear as in the source text (Text).

For instance:

d-453.A$9 would have the following values:

Filtered_Text = d453A9

Not_Filtered_Text = -.$

Additionally, I would like a second field to show the error message in case of an error. For instance, in this case, a second field in the same layout should show:

"The content of the field would be automatically corrected. Please do not use the following characters: -.$ "

Thanks in advance

What about adding...

Not_filtered_text = Filter(VAT; Filtered_Text)

Also a slight refinement...you don't need the Length functions.

Error =If( IsEmpty(Not_filtered_text);""; "Error message " & Not_filtered_text

Filter(VAT; Filtered_Text) returns Filtered_Text

To get the "unfiltered text" you would substitute the characters to filter, one by one, by nothing.

With that many characters to filter, you could do with a recursive custom function such as this one.

Not sure what Trim() has to do with this.

Right. Clearly. Too much coffee.

G

  • Author

Not sure what Trim() has to do with this.

Upss! I should have said "Filter function". Please excuse me. Thank you for the link to the funtion. It was exactly what I needed.

I have added a couple of changes to have a total of 3 fields and 2 custom functions:

- One to show the text as it is entered.

- One to show the offending characters (using the custom function provided in the link)

- One to show the corrected text (using the filtering function)

Regards

FilterText.zip

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.