Filter not refreshing in Record

Hi All,


I have a scenario like I will be displaying the record list in a grid view to the user, where the facets will be populated from one of the column, For EX: Priority.

Now the scenario is like "Priority" is having "low", "Medium" and "High", I have added a new case with "Critical" as "Priority" then the facets are not refreshing, the facets are refreshing only when I refresh the page or reload the record.


Please let me know is there a dynamic way to achieve the facets are also getting refreshed.

 

Thanks!!

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer
    Hi @karthighak69, Try enclosing the rule(Which contains facet) under with() , for example:


    with(
    local!myData: rule!myRule(),
    a!facet(
    name: "Something",
    options: Loop the Expression of a!facetOption()
    )
    )
  • Hi Alok,

    Thanks for the reply. Currently we are doing that but still filters are not getting refreshed until i refresh the page.
  • 0
    Certified Lead Developer
    As far as I know this may be expected behavior - even dynamic / expressioned facets aren't intended to update live (i.e. without even refreshing the page), since the concept is that the facet values will be relatively common things shared by many record, etc. If you think otherwise perhaps you could share some use cases and/or share your facet code so we can help further.
  • Please try: using the apply() function to write those options for us based on the constant (cons!ISSUE_STATUSES). Please refer : docs.appian.com/.../Expression-Based_User_Filters.html

    for further details.
  • 0
    Certified Lead Developer
    in reply to Karthigha Kailasam
    If Possible, can you please attach the Facet and FacetOption Expression rule code here, so that it will be easy to debug and understand what you are able to achieve as of now and whats your expectations.
  • I think the issue is on Expression rule (Query Entity) with fetch the record data, replace load to with on your Query entity Expression rule

  • You are saying, you wrote your code inside with() but still not getting refreshed.


    I suspect, generally with() variables will be refreshed after saveInto performed. But here there is no saveInto. That is the reason facet values are refreshed on reload only. @Mike already said that it is expected behavior.
  • Hi @karthighak69,
    try using the below example:

    with(
    local!pagingInfo: if(
    isnull(
    ri!query
    ),
    a!pagingInfo(
    startIndex: 1,
    batchSize: 100
    ),
    ri!query.pagingInfo
    ),
    local!queryCondition: index(
    ri!query,
    "logicalExpression|filter|search",
    null
    ),
    local!queryCondition1: index(
    local!queryCondition,
    "logicalExpression|filter|search",
    null
    ),
    local!sub1: index(
    local!queryCondition1[1],
    "field",
    null
    ),
    local!sub2: index(
    local!queryCondition1[1],
    "operator",
    null
    ),
    local!sub3: index(
    local!queryCondition1[1],
    "value",
    null
    ),
    local!deffilter: if(
    and(
    index(
    local!queryCondition,
    "field",
    null
    ) = "firstName",
    index(
    local!queryCondition,
    "operator",
    null
    ) = "not null"
    ),
    index(
    local!queryCondition,
    "value",
    null
    ),
    null
    ),
    local!requestedId: if(
    and(
    index(
    local!queryCondition,
    "field",
    null
    ) = "rp!id",
    index(
    local!queryCondition,
    "operator",
    null
    ) = "="
    ),
    index(
    local!queryCondition,
    "value",
    null
    ),
    null
    ),
    local!searchTerm: index(
    local!queryCondition,
    "searchQuery",
    null
    ),
    local!requestStatus: if(
    and(
    index(
    local!queryCondition,
    "field",
    null
    ) = "requestStatus",
    index(
    local!queryCondition,
    "operator",
    null
    ) = "="
    ),
    index(
    local!queryCondition,
    "value",
    null
    ),
    null
    ),
    local!employees: if(
    not(
    isnull(
    local!requestedId
    )
    ),
    rule!getEmployeeByyId(
    local!requestedId,
    local!deffilter,
    local!pagingInfo
    ),
    if(
    not(
    isnull(
    local!searchTerm
    )
    ),
    rule!searchEmployeesByLastName(
    local!searchTerm,
    local!deffilter,
    local!pagingInfo
    ),
    if(
    local!sub1 = "requestStatus",
    rule!getemployeeByrequestStatus(
    local!sub3,
    local!deffilter,
    local!pagingInfo
    ),
    if(
    local!sub1 = "rp!id",
    rule!getEmployeeByyId(
    local!sub3,
    local!deffilter,
    local!pagingInfo
    ),
    rule!Entity(
    local!deffilter,
    local!pagingInfo
    )
    )
    )
    )
    ),

    topagingInfo(
    1,
    1
    )

    )
  • Try to use "rich formatting editor" while posting code, images, videos or attaching files etc. Such that it would be very easy to read. The fun part in "use rich formatting" editor is, it can format all programming languages code except SAIL. So we have to format our code in the expression editor and select language text then paste your code.

     

    with(
      local!pagingInfo: if(
        isnull(
          ri!query
        ),
        a!pagingInfo(
          startIndex: 1,
          batchSize: 100
        ),
        ri!query.pagingInfo
      ),
      local!queryCondition: index(
        ri!query,
        "logicalExpression|filter|search",
        null
      ),
      local!queryCondition1: index(
        local!queryCondition,
        "logicalExpression|filter|search",
        null
      ),
      local!sub1: index(
        local!queryCondition1[1],
        "field",
        null
      ),
      local!sub2: index(
        local!queryCondition1[1],
        "operator",
        null
      ),
      local!sub3: index(
        local!queryCondition1[1],
        "value",
        null
      ),
      local!deffilter: if(
        and(
          index(
            local!queryCondition,
            "field",
            null
          ) = "firstName",
          index(
            local!queryCondition,
            "operator",
            null
          ) = "not null"
        ),
        index(
          local!queryCondition,
          "value",
          null
        ),
        null
      ),
      local!requestedId: if(
        and(
          index(
            local!queryCondition,
            "field",
            null
          ) = "rp!id",
          index(
            local!queryCondition,
            "operator",
            null
          ) = "="
        ),
        index(
          local!queryCondition,
          "value",
          null
        ),
        null
      ),
      local!searchTerm: index(
        local!queryCondition,
        "searchQuery",
        null
      ),
      local!requestStatus: if(
        and(
          index(
            local!queryCondition,
            "field",
            null
          ) = "requestStatus",
          index(
            local!queryCondition,
            "operator",
            null
          ) = "="
        ),
        index(
          local!queryCondition,
          "value",
          null
        ),
        null
      ),
      local!employees: if(
        not(
          isnull(
            local!requestedId
          )
        ),
        rule!getEmployeeByyId(
          local!requestedId,
          local!deffilter,
          local!pagingInfo
        ),
        if(
          not(
            isnull(
              local!searchTerm
            )
          ),
          rule!searchEmployeesByLastName(
            local!searchTerm,
            local!deffilter,
            local!pagingInfo
          ),
          if(
            local!sub1 = "requestStatus",
            rule!getemployeeByrequestStatus(
              local!sub3,
              local!deffilter,
              local!pagingInfo
            ),
            if(
              local!sub1 = "rp!id",
              rule!getEmployeeByyId(
                local!sub3,
                local!deffilter,
                local!pagingInfo
              ),
              rule!Entity(
                local!deffilter,
                local!pagingInfo
              )
            )
          )
        )
      ),
      topagingInfo(
        1,
        1
      )
    )