I have a large array of "Application Status" values that need to be replaced based upon conditional statements.
F.ex.
I was trying something like this:
$replace(result.fields[label = "R.Application Status"].values.value.text, ["Approved", "Missing in DocuPhase", "On hold - Pending Funding", "Only Missing Owner Clearance", "Pending Payment Processing", "Pending Quality Control Review", "Reviewed"], "Under Review")
However, this does not work and I want to get away from doing something ugly like this:
$replace($replace($replace($replace($replace($replace($replace($replace(result.fields[label = "R.Application Status"].values.value.text, "Approved", "Under Review"), "Missing in DocuPhase", "Under Review"), "On hold - Pending Funding", "Under Review"), "Only Missing Owner Clearance", "Under Review"), "Pending Payment Processing", "Under Review"), "Pending Quality Control Review", "Under Review"), "Reviewed", "Under Review")
If you only need to get a list of statuses parsed from the original object structure with certain statuses replaced, you can do it with a regular expression passed down to the $replace
function like this: https://stedi.link/RMFB0yj
Alternatively, you can achieve the same if you use a ternary expression within a map operator: https://stedi.link/bg96HrE
If you need to preserve the original structure and only want certain statuses to be replaced, then I would do it like that: https://stedi.link/wB5f9tu