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.

Checking empty and fill data ?

Featured Replies

Hi All,,

I have a script to check 2 fields if they are empty then user goes to that field and fill data . My script is

loop

if isempty(field1)

go to field1 ...endif

if isempty(field2)

go to field 2 ...endif

exit loop if field1 <> "" and field2 <> ""

end loop

but it just run very fast ..does not pause for people to fill in and go to next fill to fill in ...Some people have an example or an idea about checking empty and go to that field to fill in??

Thanks

Anh Tran

loop

if isempty(field1)

go to field1

show message "Please fill in field 1"

pause/resume

endif

if isempty(field2)

go to field 2

show message "Please fill in field 2"

pause/resume

endif

exit loop if field1 <> "" and field2 <> ""

end loop

should work (show message is optional...)

-Raz

  • Author

hello Raz,

it works fine ..

Do you know a way to check if the repeat field is empty or not ... is there a way to check the repeat field is empty or do i have to type repeat-1, repeat-2 and so on.... if the repeat field is 100 repetition ...this is long to check if one of them is not empty??? because one of them is not empty then it is fine.

Anh Phu

Anh-

That is one reason why many people advise strongly against using repeating fields unless absolutely neccessary.

Unfortunately, I believe if your repeating field is 100 repetitions long, you will need at least 100 lines of script. Or perhaps a 100 line conditional if statement:

If [is empty(getrepetition(YourField, 1) and

is empty(getrepetition(YourField, 2) and

is empty(getrepetition(YourField, 3) and...]

Show message "You must enter data in at least one line"

go to field [YourField]

Pause/Resume

End If

I would suggest you consider creating an additional related "LineItems" file that would be displayed in a portal to replace your repeating field. Will probably make things much easier later on.

-Raz

I would modify Raz's steps a little bit for efficiency.

Loop

Exit Loop If[ not IsEmpty(GetRepetition(YourField, 1)) or not isempty(GetRepetition(YourField, 2))...]

Show message "You must enter data in at least one line."

Go to Field["YourField"]

Pause/Resume Script

End Loop

The 'or's will allow the loop to terminate once one of the conditions has been met. The 'and's will require the If statement to check for all conditions before continuing. At least this is my understanding of it. Does anyone know for certain whether this is true? It seems logical, at least.

Theory sounds good, wonder what/if the difference in performance would be, allthough not quite curious enough to test it out... smile.gif

  • Author

With my knowledge it would be the same ...

Filemaker has some limitations ...about speed ...caluculation field ...summary field ...i wait forever smile.gif

Thanks Guys

Anh Phu

I just tested this with a repeating field (25 repetitions). Both performed in less than a second. Guess we need to find someone who's really bored and have them test 100 for us. laugh.gif

  • Author

I mean that the script runs fast ...but for example , if you have like 100 000 records and u have calculation field as summary...total ....then you will hire someone to test how long does it take for you .... smile.gif

smile.gif

It depends how complicated the field is you're summarizing. Number fields go relatively quickly, whereas calcs of calcs of calcs......oi vey!

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.