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.

[FMP-IF] not working right.

Featured Replies

Hi

I have a CDML page with an If/Else statement on that always results in the first case being seen as true regardless of what I compare it to!

The field (includeimage) is a calculation field which either contains No or Yes. Simplified, the CDML looks like this:

 [FMP-IF:Field:includeimage.eq.Yes]

Yes

[FMP-ELSE]

No

[/FMP-IF]

:

[FMP-FIELD:includeimage]


I added the [FMP-FIELD:includeimage] tag so I could compare what the if statement responded to with what is in the field. Whether the Field was Yes or No though, the If statement always printed the Yes. Even when I changed it to a value which isn't in any of the records being searched:

[FMP-IF:Field:includeimage.eq.xzxzxzxzxz]  

I have used If statements before with no trouble. Any idea why this isn't working? I am completely dumbfounded.

VS

[FMP-IF:includeimage.eq.Yes]

Yes

[FMP-ELSE]

No

[/FMP-IF]

:

[FMP-FIELD:includeimage]

Try the above. You will note the absence of "Field: " following fmp-if:

"The fieldis a calculation field which either contains No or Yes."

If you are using this calculation field (includeimage) to determine if another field contains data you might consider not using the calc. field but referencing directly the field the calc is based upon (e.g. a field named "image"). In which case your code might look like:

[fmp-if: image .ncn. ""]

Yes

[fmp-else]

No

[/fmp-if]

And if you are planning on serving an image, you might want to check out the Sample File which I have offered on serving images. Storing them in FileMaker is not a great idea.

  • Author

Thanks Keith

The workaround you gave me with [fmp-if: image .ncn. ""] works fine. I am still confused why on this page the standard if statements doesn't work. Surely workarounds shouldn't be necessary when employing simple syntax. I'm not using Filemaker to hold image, just their filenames. Could this be something to do with the way I have written the calculation field perhaps?

In any case, thanks for helping me get my page working,

VS

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.