Filter by month

0
Hello,  I want to filter the delivered cargo records by months (last month, last three months and all). But I couldn’t find a suitable filter widget. Do you have any suggestion?
asked
1 answers
0

Hi,

From the screenshot provided, you are using the list view with editable.

The datasource is microflow.

You can change everything to and use DataGrid2. Where you can achieve direct filters on date >, >=, <,<=, and equal.

For now, to match with what you have done, we can do the below steps

Create a SearchFilter entity that can save the SearchDeliveryDate.

Let the SearchFilter bet the datasource for the data view

Add a date-picker widget to hold the SearchDeliveryDate.

Add list view inside the dataview.

Add Microflow as the datasource. SF_CreateSearchFilter

 

On changing the date configure the on-change microflow as below

The reason we are refreshing the object is to trigger the DS flow for the list view.

The microflow for the list is below:

 

This Microflow:

  1. Retrieve all cargos that are delivered.
  2. Check the SearchDeliveryDate value exist.
  3. If the filter date exists.
  4. Create a list activity to store all cargos that fall below the selected date on the filter
    1. Yes – Loop the Cargos and check if the date is <= to the SearchDeliveryDate
      1. Yes – Add to the valid list
    2. No – continue the loop
  5. Output the Valid list
  6. No
  7. Output all the list of Cargo that are delivered.

 

If you are very particular about 3 months, 6 months filters:

Create a SearchFilter entity

Attribute = ThreeMonths  à Datatype = Boolean  à default value = false

Attribute = SixMonths  à Datatype = Boolean  à default value = false

 

Create a button that works for 3months and another for 6months

OnClick on button for 3months

Run a microflow – change the ThreeMonths attribute SearchFilter object, to true and refresh the page object

Datasource of the List View should be like

If the SearchFilter – Threemonths attribute is true

Loop the cargonlist

If Delivered date falls below three months from now then add to valid list and later output the valid list

If the SearchFilter – Threemonths attribute is false

Retrieve all the cargo list that are just delieved.

 

Hope you find it helpful!!!

 

 

 

 

 

 

 

answered