Appian Community and Appian Academy are being upgraded. As a part of the upgrade, Appian Community is currently in read-only mode, and user registration is disabled until August 3. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!

The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.

To filter date in expression rule

Certified Senior Developer

Hi All,

My scenario is to filter the below view column in appian expression rule using the two rule inputs of "date" dataype(startDate,EndDate),

We can see in screenshot, the  column is of text and its in concatenated way, is it possible to filter this from appian?

Could you please help me on this.

Thanks in Advance.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Yes it is possible you can apply the selection the particular column and use >= and <= to fetch the data between two dates and concat them using to string.

    Your query will be like this

      a!queryEntity_22r2(
        entity: cons!AA_VEHICLES_DSE_POINTER,
    
        query: a!query(
          selection: a!querySelection(
            columns: a!queryColumn(
              field: "vehicleDateAdded"
            )
          ),
          logicalExpression: a!queryLogicalExpression(
            operator: "AND",
            filters: {
    
              a!queryFilter(
                field: "vehicleDateAdded",/*field Name*/
                operator: ">=",
                value: ri!startDate
              ),
              a!queryFilter(
                field: "vehicleDateAdded",/*field Name*/
                operator: "<=",
                value: ri!endDate
              )
            },
            ignoreFiltersWithEmptyValues: true
          ),
          pagingInfo: a!pagingInfo(
            startIndex: 1,
            batchSize: 10
          )
        ),
        fetchTotalCount: false
      ).data
    

Reply
  • 0
    Certified Lead Developer

    Yes it is possible you can apply the selection the particular column and use >= and <= to fetch the data between two dates and concat them using to string.

    Your query will be like this

      a!queryEntity_22r2(
        entity: cons!AA_VEHICLES_DSE_POINTER,
    
        query: a!query(
          selection: a!querySelection(
            columns: a!queryColumn(
              field: "vehicleDateAdded"
            )
          ),
          logicalExpression: a!queryLogicalExpression(
            operator: "AND",
            filters: {
    
              a!queryFilter(
                field: "vehicleDateAdded",/*field Name*/
                operator: ">=",
                value: ri!startDate
              ),
              a!queryFilter(
                field: "vehicleDateAdded",/*field Name*/
                operator: "<=",
                value: ri!endDate
              )
            },
            ignoreFiltersWithEmptyValues: true
          ),
          pagingInfo: a!pagingInfo(
            startIndex: 1,
            batchSize: 10
          )
        ),
        fetchTotalCount: false
      ).data
    

Children