Select to view content in your preferred language

Does 'IIF arcade expression' supports in Renderer?

320
0
09-26-2023 04:28 PM
SeanKim
Occasional Contributor

Hi,

I am currently working on to using IIF syntax arcade expression in renderer which is coming from JSON.
So far, I can confirm that simple "valueExpression" in the JSON works fine such as "valueExpression='$feature.category'". But, it won't accept more complicated arcade expression using IIF condition statement.

*valueExpression
var nV = IIF($feature.nV != null && $feature.nV != $feature.v, '-'+ $feature.nV,'');
var cS = IIF($feature.cS != null && $feature.cS != 'closed', '-'+ $feature.cS, '');
IIF(IsEmpty($feature.endDate), IIF($feature.category == 'brick', $feature.v + nV + cS, $feature.v), 'expired')

*sourceCode
var serializeOptions = new JsonSerializerOptions
{
WriteIndented = true,
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping
};
string jsonRenderer = System.Text.Json.JsonSerializer.Serialize(uniqueRenderJSON[renderName], serializeOptions);
_renderer = Renderer.FromJson(jsonRenderer);
}
featureCollectionTable.Renderer = _renderer;

0 Kudos
0 Replies