_____

Widget Building Function Reference

Contents

Widget Building Function Reference#

The following table describes which functions can be applied at each widget builder stage. For more on how to use functions to set up widgets, see Advanced Setup - Widgets

const : Evaluates whether the field value matches the argument.

Example Expression

WAREHOUSE ID = const("WH5")

Example Input

_images/eg_filter_const_input.jpg

Result

_images/eg_filter_const_output.jpg

convert : Converts a value to a specified type.

Example Expression

convert(GOAL_HOURS,“int”)

Example Input

_images/convert1.png

Result

_images/convert2.png

dateFixed : Returns all records that have the specified date in the specified date field.

Works the same way as the Fixed date parameter option in Widget Properties. For more info, see Editing a Date Parameter - Advanced .

Example Expression

REPORT_DATE = dateFixed(REPORT_DATE, "2023-03-02T22:30:00.000Z")

Example Input

_images/eg_filter_dateFixed_input.jpg

Result

_images/eg_filter_dateFixed_output.jpg

dateFixedRange : Returns all records that have in the specified date field a date that’s between the ‘from’ date and the ‘to’ date (inclusive).

Works the same way as the Fixed date parameter option in Widget Properties. For more info, see Editing a Date Parameter - Advanced .

Example Expression

REPORT_DATE = dateFixedRange(REPORT_DATE,"2023-03-02T00:00:00.000Z","2023-03-04T00:00:00.000Z")

Example Input

_images/eg_filter_dateFixedRange_input.jpg

Result

_images/eg_filter_dateFixedRange_output.jpg

dateRelative : Returns all records that have in the specified date field a date that is in the dynamic date range (inclusive) counting back from today’s date.

The second argument is the number of days counting back from today’s date to get the start date and the third argument is the number of days counting back from today’s date to get the end date. Works the same way as the Days date parameter option in Widget Properties. For more info, see Editing a Date Parameter - Advanced . In the example, the dynamic date range is calculated based on May 2nd, 2023 at 12:00 AM as the current date and time.

Example Expression

REPORT_DATE = dateRelative(REPORT_DATE, -10, 0)

Example Input

_images/eg_filter_dateRelative_input.jpg

Result

_images/eg_filter_dateRelative_output.jpg

dateRelativeRange : Returns all records that have in the specified date field a date that’s within the dynamic date range that’s’based on today’s date.

If you specify a weekly range, you have to specify in the third argument which day of the week should be considered the first day of the week.Works the same way as the Relative date parameter option in Widget Properties. For more info, see Editing a Date Parameter - Advanced. In the example, the dynamic date range is calculated based on May 2nd, 2023 at 10:00 AM as the current date and time.

Example Expression

REPORT_DATE = dateRelativeRange(REPORT_DATE, BEG_OF_WEEK,MONDAY)

Example Input

_images/eg_filter_dateRelativeRange_input.jpg

Result

_images/eg_filter_dateRelativeRange_output.jpg

exists : When set to ‘true’, returns records that have the specified field even when it has only null values. If set to ‘false’, returns only records that don’t have the field.

Example Expression

USR_ID = exists(true)

Example Input

_images/eg_filter_exists_input.jpg

Result

_images/eg_filter_exists_output.jpg

regexp : Lets you select records that have a field value that matches a pattern specified as a regular expression : FIELDNAME = regexp(expression(YOUR_REGEX_EXPRESSION), options(ADVANCED_REGEX_OPTIONS).

For more information, see Selecting Records based on Patterns in String Values.

Example Expression

DESCRIPTION = regexp(expression(LOAD),options(i))

Example Input

_images/eg_filter_regexp_input.jpg

Result

_images/eg_filter_regexp_output.jpg

sysdate : Returns the system date in Coordinated Universal Time (UTC) i.e., Greenwich Mean Time.

For more info, see Building Widgets that Refer to the System Date. In the example, the function is run on April 19th, 2023.

Example Expression

TRAILER_DISPATCH_DATE >= sysdate(-1)

Example Input

_images/eg_filter_sysdate_input.jpg

Result

_images/eg_filter_sysdate_output.jpg

sysdatetz : Returns the system date in the WMS’s local time zone.

For more info, see Building Widgets that Refer to the System Date. In the example, the function is run on April 19th, 2023.

Example Expression

TRAILER_DISPATCH_DATE_LOCAL >= sysdatetz(-1, America/Adak)

Example Input

_images/eg_filter_sysdatetz_input.jpg

Result

_images/eg_filter_sysdatetz_output.jpg