filter widget select records that have a date_from and date_till attribute and the input date is in between these dates

535
6
Jump to solution
03-05-2024 01:11 AM
Stefan_Thorn
Occasional Contributor II

Hi,

It seems an easy filter but could not get it. I want the user only enter 1 date to filter records and see what restriction there are on a chosen location.

I have a hosted feature layer and each record has the attributes  [restrictions], [activity], [date_from] and [date_till] ] that I want use to filter. [date_from] and [date_till] is a given period that defines the restrictions for that record.

I created this filter:

2. Choose activity

3. Choose date activity

Stefan_Thorn_0-1709628924335.png

2. defined the activities as predefined and an extra value as default to start with an empty map for this layer

Stefan_Thorn_1-1709629033419.png

Stefan_Thorn_2-1709629143566.png

3. asking for a date. Now need to ask the date of the activity twice to filter the records in the layer.

Stefan_Thorn_3-1709629285519.png

Any ideas?

 

 

 

 

 

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
Stefan_Thorn
Occasional Contributor II

I have changed my approach, even I am still curious if there is a solution (or only a customized widget could do the trick)

Because the date of the activity is in a certain period, I created 3 filters and ask the user to say in which period the activity will take place and filter the records based on 2. and 3.

Stefan_Thorn_0-1709651263531.png

 

 

View solution in original post

0 Kudos
6 Replies
TonghuiMing
Esri Regular Contributor

@Stefan_Thorn Based on your description, There are two fields - [date_from] and [date_till], representing different meanings of dates, which is also indicated by the last screenshot.

Trying to understand your case - do you mean you want to use one date value but for two different fields?


I want the user only enter 1 date to filter records and see what restriction there are on a chosen location



0 Kudos
Stefan_Thorn
Occasional Contributor II

@TonghuiMing 

I want to ask the user a date and use that as input to select certain record(s) . I only want the record(s) were the given date is in date_from <= given date <= date_till

below screenshot of 3 of 573 records in the table. i.e. I want to select the record (objectid 92) where the activity is 'Consumenten siervuur...' on April 16.

Stefan_Thorn_0-1709647301786.png

outcome in the viewer (not the records from the table above)

Stefan_Thorn_1-1709648474763.png

 

 

TonghuiMing
Esri Regular Contributor

I see. Thanks for the screenshots. For this scenario, I think the group filter cannot deliver either, since there are two separate operators (one is on or before, the other is on or after). A custom widget might be a better solution.

0 Kudos
jcarlson
MVP Esteemed Contributor

In Experience Builder, every field gets its own filter action. As far as I know, there's nothing like the "Group Filter" widget like there was with Web App Builder, so you can't have a single input act against multiple fields.

Is it possible to make the layer time-aware and just use a time slider widget instead?

- Josh Carlson
Kendall County GIS
0 Kudos
TonghuiMing
Esri Regular Contributor

The group filter feature has been provided in the latest AGOL Feb release. See details in this post or the official documentation.

0 Kudos
Stefan_Thorn
Occasional Contributor II

I have changed my approach, even I am still curious if there is a solution (or only a customized widget could do the trick)

Because the date of the activity is in a certain period, I created 3 filters and ask the user to say in which period the activity will take place and filter the records based on 2. and 3.

Stefan_Thorn_0-1709651263531.png

 

 

0 Kudos