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

If statement problem- for me- on how to detect several items

Featured Replies

I have a lot of records which end in either

.org/  .com/  .us/  .net/ 

 

How can I write a statement that determines if any of those are present?

 

The way I have been doing it is to write 4 separate statements.

I am asking how to write it correctly if there are a lot of different texts strings that I am trying to detect.

 

In my own words

It would be something like this

 

If

my field  ends with ".org/ " ".com/ "" .us/ " " .net/ " 

Perform script

 

But they are not always 4 characters. Thats the problem.

 

PLease help if this is not hard for you.

Thanks

 

Check out the patterncount() function, user one for each string you want to test for.

What is the script supposed to do?

  • Author

The script is supposed to find the presence of .org/ .us/ .net/ .com/ 

if the end of the text in my text field ends with one of those.

 

If that is the case I want to play a script I already use.

If that is not the case to do nothing.

I am asking how to write it correctly if there are a lot of different texts strings

 

Do you mean: lots of strings to test, or to test against? If the latter, then you could try

Let ( [
  allowedDomains = "org¶com¶us¶net" ;
  thisDomain = Substitute ( YourTable::yourSourceField ; [ "." ; ¶ ] ; [ "/" ; "" ] ) ;
  thisDomain = RightValues ( thisDomain ; 1 ) 
  ] ;
  not IsEmpty ( FilterValues ( thisDomain ; allowedDomains ) )
)

For just four strings, that not really progress in comparison to PatternCount(); but instead of hardcoding a list of allowed domains, you could reference e.g. a field with such a list, and extend that list without having to modify the calculation.

The script is supposed to find the presence of .org/ .us/ .net/ .com/ 

if the end of the text in my text field ends with one of those.

 

If that is the case I want to play a script I already use.

If that is not the case to do nothing.

That was the purpose of my question - What will the script do as a result of the present of these file extensions?

 

ADDED:

 

Copy the script so that we can see what your intent will be.

Edited by Lee Smith
ADDED

  • Author

The script just copies the contents of one field to another

 

If those Items are present at the end of the text string

 

The script "Copy to web address"

Is

Set field  generic list gather::web address Copy

  • Author

Thank you all of you I have it working now

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.