Query Entity Records How to handle NVL conditions

Hi,

I’m using Query Entity Records Activity, and passing Argument/Variable to the condition as per the screen shot below. I would like to handle the following case:

  • In case the Argument/Variable is NULL then I need to retrieve all the records.
    I know I can use If-else however I have complex query and using if-else will not be practical.

image

Appreciate any hints
Thanks in advance

@hgaber105

Other than using if conditions I dont think you have any other way as of now

Cheers

What about referencing other columns in the query, such as
create_date < update_date + 10

Thanks in Advance

@hgaber105

After getting records may be from there you can apply linq and filter further records

cheers

@hgaber105 You can use the below code into your data table

var results = (from e in YourEntities // Replace with your actual entity collection
              where YourArgument == null || e.YourField == YourArgument
              select e).ToList();

YourArgument == null => This will check if your Argument is null and query not check the next condition, This should be your first condition to check
I hope @hgaber105 it sove your issue.