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.

CDML If statement to test valuelistitem...

Featured Replies

OK, I'm trying to return a value list from my database.

But in my format file I'm trying to something involving an if statement.

I have...

[FMP-ValueList: press CLASSIFICATION, List=press CLASSIFICATION]

at the start to loop through the value list items.

And for each I'm trying to do this...

[FMP-If: ValueListItem .cn. test]

<a href="http://www.domain.com/foo.php?classification=test">[FMP-ValueListItem]</a>

[FMP-Else]

<a href="http://www.domain.com/foo.php?classification=normal">[FMP-ValueListItem]</a>

[/FMP-If]

[/FMP-ValueList]

But it isn't working. I'm trying to say, if the current value list item contains the word test, then do one thing, else do the other thing.

Is this possible?

Has anybody else managed this?

Thanks

I remember something about ValueLists and FMP-Ifs being a problem. I think the solution may have been to use Javascript Ifs.

It maybe worthwhile to do some more testing as this is just a vauge memory.

Good Luck.

Garry

From what I read in the CDMLRdb you might try using:

[FMP-If: FieldNameinwhichyouhavetheValueListItem .cn. test]

since, according to the CDMLRdb:

"ValueListItem - Returns the current value list item"

unless the latter is what you desire.

  • Author

What I'm trying to do is detect whether the current value list item contains certain text.

Because I am looping through the value list using

[FMP-ValueList] and [/FMP-ValueList]

For the time being I've solved the problem using PHP, but I'm sure I'll need to do something involving this at some point.

I've tried getting the field value, but for that particular record that valuelistitem might not be selected.

Any other ideas?

I couldn't get my ValueList IF to work.. hope you have better luck!

--ST

  • Author

Yeah I've given up and solved it using PHP for the time being.

Pretty annoying.

I'll let you guys know if it works.

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.