From d0658be85dd19ee42bb9a3b795e1dfb19312bf58 Mon Sep 17 00:00:00 2001 From: David Droz <87832607+ddroz0924@users.noreply.github.com> Date: Fri, 10 Jul 2026 08:53:38 -0700 Subject: [PATCH] Update CountRecordsAndFields for Boolean field values.cls I found that CountRecordsAndFields did not recognize boolean field values. I added recValue object variable to pull whatever the value is of the record. Then cast recValue as a string so that it can be compared to the fieldvalue input string. --- .../main/default/classes/CountRecordsAndFields.cls | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/flow_action_components/CollectionProcessors/force-app/main/default/classes/CountRecordsAndFields.cls b/flow_action_components/CollectionProcessors/force-app/main/default/classes/CountRecordsAndFields.cls index 9bc040090..c22b9c0a5 100755 --- a/flow_action_components/CollectionProcessors/force-app/main/default/classes/CountRecordsAndFields.cls +++ b/flow_action_components/CollectionProcessors/force-app/main/default/classes/CountRecordsAndFields.cls @@ -12,13 +12,15 @@ global with sharing class CountRecordsAndFields { try { for (SObject record : records) { if (!String.isBlank(fieldName) && !String.isBlank(fieldValue)) { - if (record.get(fieldName) == fieldValue) { + Object recValue = record.get(fieldName); + if (recValue != null && + String.valueOf(recValue).equalsIgnoreCase(fieldValue)) { response.matchedNumber++; } } - response.totalNumber++; } + } catch (Exception ex) { response.errors = ex.getMessage(); } @@ -54,4 +56,4 @@ global with sharing class CountRecordsAndFields { @InvocableVariable global String errors; } -} \ No newline at end of file +}