Filter a list of wraps

The text fields at the top of a list of wraps allow you to filter the list using many different conditions, using the syntax described here.

When you work with ExcelWraps, you often arrive at lists of wraps that look almost the same anywhere you find them.

Column filters

On top of many columns in the list is a text field where you can enter a filter for the column.

If a cell does not have a filter field, it may be either unnamed or contains a MyWraps2() result. Neither of these cell types is searchable. If you want to filter the list on a cell that doesn’t have a filter field, you need to name the cell in the wrap template.

Screenshot of column filters in MyWraps

Using the column filter wizard

Each filter field has a “filter” symbol to the right which offers assistance when you need to design a more complex filter.

When you click on the “filter” symbol, a dialog opens.

Screenshot of the Filter Column wizard in MyWraps

In this dialog, you press the plus sign once for each condition you wish to insert.

For each condition, you first select the operator.

Screenshot of the operators you can use in the filter column wizard in MyWraps

Example: If you use the Equal To operator, you want to include only the wraps that have a certain value for this cell. You then enter this value into the Parameter field.

Some data types offer more assistance than others. For date values, you can select the date and time using a calendar widget. When you press Done, a timestamp is generated automatically from your selections in the calendar. You can also press Now to insert the current date and time in the wrapsite’s time zone.

Screenshot of the calendar widget used in the filter column wizard in MyWraps

When you press Apply, the filter is generated with the correct syntax and entered into the filter field.

List of filter operators

If you don’t need to use the column filter wizard, you can enter the filter directly into the filter field.

The possible operators that you can use as column filters are:

  • hello – show only wraps where the field contains ‘hello’ in any position, co is the default operator for string values 1
  • co(hello) – show only wraps where the field contains ‘hello’ in any position 1
  • nc(hello) – show only wraps where the field does not contain ‘hello’ in any position 1
  • sw(hello) – shows only wraps where the field starts with ‘hello’
  • eq(hello) – show only wraps where the field is equal to the exact string ‘hello’
  • ne(hello) – show only wraps where the field is not equal to the exact string ‘hello’
  • 10 – show only wraps where the field’s value is equal to 10, eq is the default operator for numeric values
  • eq(10) – show only wraps where the field’s value is equal to 10
  • ne(10) – show only wraps where the field’s value is not equal to 10
  • gt(1) – show only wraps where the field’s value is greater than 1
  • ge(1) – show only wraps where the field’s value is greater than or equal to 1
  • lt(1) – show only wraps where the field’s value is less than 1
  • le(1) – show only wraps where the field’s value is less than or equal to 1
  • eq() – show only wraps where the field is empty
  • ne() – show only wraps where the field is not empty

1 The co and nc operators require extra processing that may make the filter slow when there are many wraps. If possible, use sw, eq or ne instead, or try to limit the number of wraps by adding an eq or ne filter for a different column. This efficient filter will be applied first, and the resource-consuming co or nc operator applied only on the filtered wraps.

Text filters

For text fields, you can enter any part of the value you wish to filter on and press Enter to hide the wraps that do not contain this value in the column.

Example: if you enter “y” in the text field above the month column and press Enter, only the May wrap will appear. This is an example of the co (contains) operator, which is implied for string values if no explicit operator is used.

Using the explicit operators eq (equal) or ne (not equal) will filter the list faster, since they require less processing than the co or nc operators.

Numeric filters

For numeric fields, you can enter any value that you wish to filter on and press Enter to hide the wraps that do not have this value in the column.

Example: if you enter the current year in the text field above a year column and press Enter, you hide all wraps that are not from the current year. This is an example of the eq (equal to) operator, which is implied for numeric and date values if no explicit operator is used.

You can also use explicit operators like gt (greater than), ge (greater than or equal to), lt (less than), or le (less than or equal to).

Comparison is numeric, so 10 and 10.0 are equal and -10 has a lower value than -9.

Date and time filters

For dates, the filter must be in ISO-standard yyyymmdd format , e.g. lt(20221225) means any date before Christmas Day 2022.

DateTime filters must use a 24-hour yyyymmddhhmmss format.

ExcelWraps always operates in the time zone set for the wrapsite.

Wrap filters

Creator filter

Some lists have a Creator filter that allows you to view only the Wraps that are created by Me (the logged-in user) or Any (created by anyone).

State filter

Some lists have a State filter that allows you to hide frozen wraps or show only wraps you need to sign or have signed.

  • Live – Show all wraps that are not yet frozen, i.e. work in progress. Wraps freeze when the last signature has been made to indicate the completion of a process.
  • Frozen – Show only wraps that are frozen and cannot be modified further.
  • AwaitingSignature – Show only wraps that are waiting for your signature.
  • SignedByMe – Show only wraps that you have signed.
  • In some lists, there is also an AutoNumber filter where you can explicitly select the First wrap (with the lowest auto number), Last (highest-numbered), or LastFrozen (most recently frozen).
  • Any – Shows you all the wraps.

AutoNumber filter

An AutoNumber cell can be included in the unique key for a wrap, and automatically assigns a unique serial number to each wrap. As an example, all errors reported for a vehicle can get a unique serial number that advances by one for each new error report. Read more in the help for the AutoNumber unique key setting on the Wrap tab in WrapCreator.

To filter wraps on their AutoNumber, you can use an ordinary column filter. If you type 12842 in the text box above the AutoNumber column, you will retrieve the wrap with that autonumber. If this autonumber does not exist, the filtered list of wraps will be empty.

There are also three special cases that return exactly one wrap. These filters are specified in the Filter setting above the list of wraps.

  • The First wrap is the one with the lowest AutoNumber. It was the first wrap to be created, and it is the oldest.
  • The Last wrap is the one with the highest AutoNumber. It was the most recent wrap to be created, and it is the youngest.
  • The LastFrozen wrap is the one that was most recently frozen. This is often used when filtering for the most recent complete period of automatically saved KPIs.

If your report has an AutoNumber=LastFrozen filter, this is a secondary filter that will be applied on the records returned by primary filtering, which is restricted by MaxRows. If you have many wraps, you may have to increase the MaxRows number to accommodate all the wraps, of which only one can be the last frozen.

To increase performance and remove the need to increase MaxRows, MyWraps has an IsLastFrozen filter. If the IsLastFrozen property of a wrap is true, it tells you that this wrap was the one most recently frozen. When filtering wraps for AutoNumber=LastFrozen, you should always also filter for IsLastFrozen, e.g.

Options.AutoNumberFilter=LastFrozen&Filter.IsLastFrozen=true

The IsLastFrozen property is only available for wrap templates with an AutoNumber unique key designated on the Wrap tab in WrapCreator.

A routine runs asynchronously to continuously reassign the IsLastFrozen property to the wrap that was most recently frozen. If data is constantly updated, you may wish to ensure that the last frozen wrap is set as IsLastFrozen immediately before you filter for it. You do this with the Request All Wraps update IsLastFrozen action in MyWraps. 

MyWraps has limited error handling

Since MyWraps is intended for administrators, there may sometimes appear to be room for improvement of the user interface. If unexpected conditions occur, they may be presented to the developer as

Screenshot of the general "oops" message provided by MyWraps for unexpected conditions

Before you contact Client Services, please make a quick pass through the data you have entered to ensure that there are no errors. As an example, entering a column filter as “gte(5)” instead of “ge(5)” for a greater-than-or-equal comparison will result in the error message above.