Populate data by default into a grid

I am using a!queryEntity() to bring data from the database. I am populating a grid with that data. I have a search filter on top of my grid which will alter the grid depending on what is typed. This would also mean that I am a!queryFilter() within my a!queryEntity(). I want all the data to be populated by default in my grid. In the attached code, you will see that I have an if condition. If the search parameter is null, I want to display all of the data (that is the part I am missing). Any ideas how would I accomplish this?

queryEntity.txt

OriginalPostID-190320

OriginalPostID-190320

  Discussion posts and replies are publicly visible

Parents
  • @prernas Hi, whatever you have said completely depends on the scenario. If you have only one filter and just making use of the 'filter' argument without making use of the 'logicalExpression' argument, then definitely null values are allowed. For instance, the code snippet which I have uploaded above after making a correction or comment made by @jacobc thereafter is an perfect example for it and the user is happy with it as well. The same is explained at https://forum.appian.com/suite/help/16.1/Appian_Data_Types.html#Query as follows: "This optional field determines the filtration to apply to the query." This obviously states that 'logicalExpression' or 'filter' or 'search' argument is completely optional.

    The comments made by you makes perfect sense when the 'logicalExpression' argument is used, which is generally used in case of multiple filters. Off-course even this way can also be used in the example here but we should also bear in mind that there isn't a problem with defining the null value for the 'filter' argument.

    And to make the conclusion simple - you are defining the 'logicalExpression' as null when the filters aren't present. In the same way, the 'filter' argument can be defined as null if the filter we need to pass is null.
Reply
  • @prernas Hi, whatever you have said completely depends on the scenario. If you have only one filter and just making use of the 'filter' argument without making use of the 'logicalExpression' argument, then definitely null values are allowed. For instance, the code snippet which I have uploaded above after making a correction or comment made by @jacobc thereafter is an perfect example for it and the user is happy with it as well. The same is explained at https://forum.appian.com/suite/help/16.1/Appian_Data_Types.html#Query as follows: "This optional field determines the filtration to apply to the query." This obviously states that 'logicalExpression' or 'filter' or 'search' argument is completely optional.

    The comments made by you makes perfect sense when the 'logicalExpression' argument is used, which is generally used in case of multiple filters. Off-course even this way can also be used in the example here but we should also bear in mind that there isn't a problem with defining the null value for the 'filter' argument.

    And to make the conclusion simple - you are defining the 'logicalExpression' as null when the filters aren't present. In the same way, the 'filter' argument can be defined as null if the filter we need to pass is null.
Children
No Data