Below is a query to check if List Records in Dynamics 365 in Azure Logic App contains some data and is not nulllength(body('List_accounts')?['value'])
length(body('List_accounts')?['value'])