Hi I need to search a JSON response for all values of the key "columnName" that begin (only begin) with a specific string pattern of...
"IDM_"
For all matches I want to include a key/value "IDM":true and for any unmatched items "IDM":false on each object.
Thanks in advance.
{
"columnPermissions": [{
"$id": "1474",
"columnName": "IDM_ID"
}, {
"$id": "1475",
"columnName": "IDM_CreateDate"
}, {
"$id": "1476",
"columnName": "IDM_CreatedBy"
}, {
"$id": "1480",
"columnName": "First_Name"
}, {
"$id": "1481",
"columnName": "Last_Name"
}]
}
You can loop through the
columnPermissionsarray and setIDMproperty based on whether columnNamestartsWith"IDM_"