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.

Need to Find based on Multiple find when using a script

Featured Replies

I need to find records that meet a certain request when using a script. 

I've got 2 fields that I need to find across.

Status and Timestamp.  (Timestamp is a timestamp field)

I need to find all records that Status = "Approved"

Also need it to return all records that Status = "Complete" and have a timestamp range from 3am until Current time.

 

I'm not seeing how I do multiple find request using a script.

Thanks for your help.

I'm not seeing how I do multiple find request using a script.​

The way to do that is to use the New Record/Request step:

Enter Find Mode
Set Field [ Table::status ; "Approved" ]
New Record/Request

Set Field [ Table::status ; "Complete" ]
Set Field [ Table::timeStampField ; ">" & Time ( 3 ; 0 ; 0 ) ]
Set Error Capture [ on ]
Perform Find

This part is not clear:

have a timestamp range from 3am until Current time.

​From 3am when? Today? What if the current time is less than 3am?

 

I'm not seeing how I do multiple find request using a script.

​One way is to enter find mode, fill out the first request, then call New Record/Request to create another request.

 

  • Author

The way to do that is to use the New Record/Request step:

Enter Find Mode
Set Field [ Table::status ; "Approved" ]
New Record/Request

Set Field [ Table::status ; "Complete" ]
Set Field [ Table::timeStampField ; ">" & Time ( 3 ; 0 ; 0 ) ]
Set Error Capture [ on ]
Perform Find

​This worked Perfect..Never Knew the New Record/Request was for that. 

Thanks

  • Author

This part is not clear:

​From 3am when? Today? What if the current time is less than 3am?

Your right...Never thought of this part.​

Ot looks like I will need to do an If script that looks a the current time.

If current time is after 3 am then it will need to find based on today date after 3am.

If Current time is between 12am and 2:59am then it needs to find today date between 12am and 2:59 and Yesterday date till 3am.

I guess the part I would need help on is the 2nd If Statement. How do you do a between date?

 

If Current time is between 12am and 2:59am then it needs to find today date between 12am and 2:59 and Yesterday date till 3am.

​I am afraid that's not quite clear either.

  • Author

The Issue is that Days end does not end at 12pm. Their day ends at 3am. So when they run this report  after 12pm and before 3am

They need to only show stuff that was done from the previous day after 3am plus anything that was done between 12am-3am the same day.

I think I've got something that is working, will need to test.

I set a Set a Variable $$TIME_OFFSET

If ( Get ( CurrentTime ) > "12:00:00 AM"; If ( Get ( CurrentTime ) < "03:00:00 AM" ; "TRUE" ; "FALSE" ) ; "FALSE" )

Then I did an IF based script on the TRUE/FALSE Variable to know what FIND script to run based on the current time.

Edited by Devin

Do they have any future records? If not, you can find the relevant records - i.e. records that occurred after the most recent 3:00 AM - by:

Enter Find Mode []
...
Set Field [ YourTable::YourField ; "≥" & Timestamp ( Get(CurrentDate) - ( Get(CurrentTime) < 10800 ) ; 10800 ) ]
...
Perform Find

Note: 10800 is shorthand for Time ( 3 ; 0 ; 0 ).

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.