How to perform case-insensitive string comparison in Creatio server-side C# Select query?
23:19 Sep 12, 2025
Hi Team,
I’m trying to implement a server-side utility method in Creatio to fetch the Id from a table by matching the Name field.
The challenge is that the value comparison should be case-insensitive (e.g., "Test"
, "test"
, "TEST"
should all match the same record).
I have tried with several ways to resolve it but could not.
Query:
What’s the recommended way in Creatio server-side C# to do a case-insensitive comparison when querying lookups (via Select
or EntitySchemaQuery
)?
Here’s my current code:
public static Guid GetValueIdCached(string tableName, string name, Dictionary<string, Guid> cache) { if (string.IsNullOrWhiteSpace(name)) return Guid.Empty; if (cache.TryGetValue(name, out Guid cachedId)) return cachedId; name = name.Trim().ToLower(); var selectQuery = new Select(_userConnection) .Top(1) .Column("Id") .From(tableName) .Where("Name").IsEqual(Column.Parameter(name)) as Select; Guid resultId = selectQuery.ExecuteScalar<Guid>(); cache[name] = resultId != Guid.Empty ? resultId : Guid.Empty; return resultId; }
Like
0 comments