Reels : How to use regex pattern for filtering record in master data

I am trying to retrieve Reels master data using JSON APIs, but I’m unable to use the $regex pattern.
I need to implement logic to fetch records where only the last four digits match the SSN.

I tried using the following syntax, but it’s not working.
Could you please suggest the correct syntax or an alternative approach to achieve this?

@Sam @Paul_Thomas

3 Likes

Hi @shubham.dhamne , our API supports only wildcard search and not direct $regex filtering in the filter object.

{
“multiplicity”: “multiple”,
“filter”: {
“Policy.Parties.Insured.SSN”: “*6789”
}
}

4 Likes

hi @Rocky I m bulging quite complex query,

“$or”: [
{ “Policy.Parties.Insured.SSN”: “*6789” },
{ “Policy.Parties.Owner.SSN”: “*6789” },
{ “Policy.Parties.Annuitant.SSN”: “*6789” }
]

for $or condition is not working as expected, giving me error as, bad filter object. I tried using $eq aslo but still giving me same error and also if I keep only one record as “Policy.Parties.Insured.SSN”: “*6789” its matches to “6789”, “9876“ , 9786 basically all combinations..

do we have exact regex option?

//————————————whole payload————————–

{
“pageNumber”: 0,
“pageSize”: 10,
“multiplicity”: “multiple”,
“filter”: {
“$and”: [
{
“Policy.Status”: { “$in”: [“Active”, “In-Force”] }
},
{
“$or”: [
{ “Policy.Number”: { “$eq”: “TL123456” } },
{
“$or”: [
{ “Policy.Parties.Insured.SSN”: “*6789” },
{ “Policy.Parties.Owner.SSN”: “*6789” },
{ “Policy.Parties.Annuitant.SSN”: “*6789” }
]
},
{
“$or”: [
{
“$and”: [
{ “Policy.Parties.Insured.Name.First”: { “$eq”: “Rahul” } },
{ “Policy.Parties.Insured.Name.Last”: { “$eq”: “Sharma” } },
{ “Policy.Parties.Insured.DOB”: { “$eq”: “1990-01-01” } }
]
},
{
“$and”: [
{ “Policy.Parties.Owner.Name.First”: { “$eq”: “Rahul” } },
{ “Policy.Parties.Owner.Name.Last”: { “$eq”: “Sharma” } },
{ “Policy.Parties.Owner.DOB”: { “$eq”: “1990-01-01” } }
]
},
{
“$and”: [
{ “Policy.Parties.Annuitant.Name.First”: { “$eq”: “Rahul” } },
{ “Policy.Parties.Annuitant.Name.Last”: { “$eq”: “Sharma” } },
{ “Policy.Parties.Annuitant.DOB”: { “$eq”: “1990-01-01” } }
]
}
]
}
]
}
]
},
“select”: [
“Policy.Number”,
“Policy.Status”,
“Policy.Plan.Name”,
“Policy.Plan.Type”,
“Policy.Parties.Insured.Name.First”,
“Policy.Parties.Insured.Name.Last”,
“Policy.Parties.Insured.DOB”,
“Policy.Parties.Insured.SSN”,
“Policy.Parties.Owner.Name.First”,
“Policy.Parties.Owner.Name.Last”,
“Policy.Parties.Owner.DOB”,
“Policy.Parties.Owner.SSN”,
“Policy.Parties.Annuitant.Name.First”,
“Policy.Parties.Annuitant.Name.Last”,
“Policy.Parties.Annuitant.DOB”,
“Policy.Parties.Annuitant.SSN”
],
“distinct”:
}

1 Like

Hi @shubham The wildcard search with "Policy.Parties.Insured.SSN": "*6789" is working as expected on my end—it matches suffix "6789" correctly and does not return permutations like "9876" or "9786".

Specifically, column like "Policy.Parties.Owner.SSN" is of a numeric type instead of string, the filter using wildcard patterns *6789 will fail validation.

1 Like

@Rocky Yes, actually in master data there was issue, there is mismatch in datatypes for some fields, due to which I’m getting this error. Thanks for your support.

1 Like

the coee is sorted and got this answer

whole custome code for filter.txt (15.1 KB)