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.

just a little problem with OR

Featured Replies

I am trying to gather the layout names in an IF statement. Below is what I am trying to do with multiple options, but can't get it right. Any help is appreciated. thanks!

If [RightWords ( Get ( LayoutName ) ; 1 ) = "menu" or "detail" or "details" or "issues" or "edit" or "adminEdit" or "check" or "admin" or "list" or "MSLlist" or "status" ]

*******************************

OK,

I was able to make the following work. But is there a cleaner way to do this?

If [ RightWords ( Get ( LayoutName ) ; 1 ) = "menu" or RightWords ( Get ( LayoutName ) ; 1 ) = "detail" or RightWords ( Get ( LayoutName ) ; 1 ) = "details" or RightWords ( Get ( LayoutName ) ; 1 ) = "issues" or RightWords ( Get ( LayoutName ) ; 1 ) = "edit" or RightWords ( Get ( LayoutName ) ; 1 ) = "adminEdit" or RightWords ( Get ( LayoutName ) ; 1 ) = "check" or RightWords ( Get ( LayoutName ) ; 1 ) = "admin" or RightWords ( Get ( LayoutName ) ; 1 ) = "list" or RightWords ( Get ( LayoutName ) ; 1 ) = "MSLlist" or "status" ]

Edited by Guest
new information

Try this

If [

RightWords ( Get ( LayoutName ) ; 1 ) = "menu" or

RightWords ( Get ( LayoutName ) ; 1 ) = "detail" or

RightWords ( Get ( LayoutName ) ; 1 ) = "details"

]

The above is a much shortened version of your requirement. Notice that each "quoted" item is compared individually. For ease of reading the individual tests are separated to different lines, which FM will permit you to do.

Edited by Guest

How about using something like this?

If [

not IsEmpty(

FilterValues(

"menu¶detail¶details¶issues¶edit¶adminEdit¶check¶admin¶list¶MSLlist¶status";

RightWords ( Get ( LayoutName ) ; 1 ) )

)

]

Edited by Guest

Even less is needed:

If[

PatternCount(

"¶menu¶detail¶details¶issues¶edit¶adminEdit¶check¶admin¶list¶MSLlist¶status¶";

"¶" & RightWords( Get( LayoutName ); 1 ) & "¶"

)]

  • Author

Thanks both. I understand the FilterValue version. I am confused on the PatternCount.

Your returns "¶" are separating the words, and also is the pattern being looked for. The combination of the word & "¶", correct? Could this character be anything? Say the underscore "_" ? That is already in the layout names, ie, _form, _guest, etc.

Then you are making that combination with the Get & "¶".

What is the & "¶" at the end of the calc for ?

  • Author

Thanks, I did get it to work as follows. I didn't understand the extra "¶" at the end and didn't use it. I also changed to the underscore "_". It all seems to be working. Thank you so much!

PatternCount ( "_menu_detail_details_issues_edit_adminEdit_check_admin_list_MSLlist_status" ; "_" & RightWords ( Get ( LayoutName ) ; 1 ) ) or PatternCount ( "_form_guest_detail_guest" ; "_" & RightWords ( Get ( LayoutName ) ; 2 ) )

...since you had "detail" both in singular and plural, would the patterncount arrive to two - my calc searches for the entire string including the pilcrow delimiter in both ends of each category, not that it matters in a if statement but more not to clutter the logic behind.

--sd

  • Author

That makes sense. Thanks for the explaination and great thought. I will add that in to both.

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.