Hi I have a scenario wherein I am displaying data in a grid on SAIL f

Hi

I have a scenario wherein I am displaying data in a grid on SAIL form via. a!queryEntity.
I have to provide two filters to user of Start date and End date (both calendars) which actually will query the same column in my DB whose type is timestamp i.e. between the range of this start and end date selected, the data will be filtered in the grid.

If I try to achieve this via. where(search(....)) on a!queryEntity I get an output where my date in DB is equal to the date selected in user filter.

So I guess I need to do it via. a!queryEntity as a number of operators are available here, but not able to figure it out how to do the same.

Can any one please guide me how to achieve this functionality.

Thanks in advance....

OriginalPostID-182998

OriginalPostID-182998

  Discussion posts and replies are publicly visible

Parents
  • @komalc Here goes the syntax which is one of the ways of handling it:

    a!queryEntity(
    entity: cons!MY_ENTITY,
    query: a!query(
    selection: ,
    logicalExpression: a!queryLogicalExpression(
    operator: "AND",
    filters: {
    a!queryFilter(
    field: "",
    operator: ">=",
    value:
    ),
    \ t a!queryFilter(
    field: "",
    operator: "<=",
    value:
    )
    }
    ),
    pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: - 1
    )
    )
    )


    Example:
    a!queryEntity(
    entity: cons!MY_ENTITY,
    query: a!query(
    selection: null,
    logicalExpression: a!queryLogicalExpression(
    operator: "AND",
    filters: {
    a!queryFilter(
    field: "created",
    operator: ">=",
    value: datetime(2014,09,05)
    ),
    \ t a!queryFilter(
    field: "created",
    operator: "<=",
    value: datetime(2014,09,06)
    )
    }
    ),
    pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: - 1
    )
    )
    )

    Also Appian has specified how to deal with date field at https://forum.appian.com/suite/help/7.9/Query_Recipes.html#Querying_on_Multiple_Conditions. So accordingly you may also develop a way to handle date time and time stamps.

    Still if you are struck, please add some more info to your post such as the type of column in your cdt, sail component (a!dateField or a!dateTimeField) used to capture the filter values and let's see if any other practitioners could come up with better responses.
Reply
  • @komalc Here goes the syntax which is one of the ways of handling it:

    a!queryEntity(
    entity: cons!MY_ENTITY,
    query: a!query(
    selection: ,
    logicalExpression: a!queryLogicalExpression(
    operator: "AND",
    filters: {
    a!queryFilter(
    field: "",
    operator: ">=",
    value:
    ),
    \ t a!queryFilter(
    field: "",
    operator: "<=",
    value:
    )
    }
    ),
    pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: - 1
    )
    )
    )


    Example:
    a!queryEntity(
    entity: cons!MY_ENTITY,
    query: a!query(
    selection: null,
    logicalExpression: a!queryLogicalExpression(
    operator: "AND",
    filters: {
    a!queryFilter(
    field: "created",
    operator: ">=",
    value: datetime(2014,09,05)
    ),
    \ t a!queryFilter(
    field: "created",
    operator: "<=",
    value: datetime(2014,09,06)
    )
    }
    ),
    pagingInfo: a!pagingInfo(
    startIndex: 1,
    batchSize: - 1
    )
    )
    )

    Also Appian has specified how to deal with date field at https://forum.appian.com/suite/help/7.9/Query_Recipes.html#Querying_on_Multiple_Conditions. So accordingly you may also develop a way to handle date time and time stamps.

    Still if you are struck, please add some more info to your post such as the type of column in your cdt, sail component (a!dateField or a!dateTimeField) used to capture the filter values and let's see if any other practitioners could come up with better responses.
Children
No Data