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.

how can i determine if field is empty using script

Featured Replies

Hello,

I am developing a help form and there is a field call date resolved that i want find out if it is empty.

This is the script i have right now:

Enter Find Mode []

Paste Result ["resolve date", """"]

Paste result ["assign to", "Status(CurrentUsername)"]

Perform Find []

Enter Browser Mode []

So i just want to display those record which have the empty field resolve date for the current user.

Thanks,

victor

Hi,

Several comments :

1) Avoid Copy/Paste and prefer Set Field

2) Try using a calculation Case(IsEmpty(your field,1,0)

3) With this calc, you could :

-----> search the 1

-----> Use a relationship with a global at left side (populated with 1) and this calc at left.

Therefore, you'll end using

If (is Valid (your relationship: a field)) or If (Is Empty(your relationship:: a field) or IF(not Is Empty (your relationship:: a field) or If not Is Valid (....

which would be quicker...

Ugo's correct about Set Field in general being preferred, since it doesn't require the script go to a particular layout or depend on the field being on the layout.

However, dates have particular quirks that generally require the use of Insert Calculated Result, or in the case of older FileMaker, Paste Result. Set Field will only work when you want to find a particular date, and even then requires the DateToText function.

Victor, what you want in your Paste Result is an equal sign with quotes around it: "=". The symbol used to find empty fields is an equal sign by itself. Or you could search for dates greater than your earliest date, i.e. "< 1/1/1900," and then Show Omitted -- but that wouldn't work so well with your other criteria.

Yes Tom,

I just don't like Insert Calculated result, as it has the same restrictions than paste... smirk.gif

  • Author

Thanks all.

I used the "=" it work great.

This what i have right now

Enter Find Mode []

Paste Result ["resolve date", ""=""]

Paste result ["assign to", "Status(CurrentUsername)"]

Perform Find []

Enter Browser Mode []

Thanks all for you help.

Victor

Hi,

Do me a favour and have a test with this.

Create a calcfield = c_checkempty = Case(Is Empty(resolve date), 1, 0)

Create a global field and populate it with 1

Create a relationship global field::calcfield

Then use this script.

If Is Valid(relationship::Record_Id)

Go to Related record (relationship, show only)

Go to Record(first)

Loop

Goto record(next - stop script when last)

Set Field (assign to, Status(Current Username)

End Loop

Else

Exit record.

Browse Mode

You will probably note some improvements. As Tom pointed out the Paste need your field to be on the layout.

If you were to change some layouts, your script wouldn't work anymore.

Moreover, relationship are quicker.

Of course, if you're using an older version....

Hopefully, no-one noticed that previous post....

So change it to :

Create a calcfield = c_checkempty = Case(Is Empty(resolve date), 1, 0)

Create a concanated calc = assign to & "-" & c_checkempty

Create a global field and populate it with a list with "username 1" (John 1, Mike 1, ...)

Create a relationship global field::concanated

Then use this script.

If Is Valid(relationship::Record_Id)

Go to Related record (relationship, show only)

Else

Exit Record.

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.