I have a large array of "Application Status" values that need to be replaced based upon conditional statements.
F.ex.
- If the app status is "Approved" or "Missing in DocuPhase" or "On hold - Pending Funding" or "Only Missing Owner Clearance" or "Pending Payment Processing" or "Pending Quality Control Review" or "Reviewed", the Portal status = Under Review
- If app status is "On Hold - Funding Exhausted", the Portal status = Exhausted
- If the app status is "Denial Pending" or "Denial PQCR" or "Review Finalized", the Portal status = Denied
- If the app status is "Payment Import" or "Payment Sent", the Portal status = Disbursed
- Else (any other app status) = Requested
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")