Arcade expressionInfos

559
1
09-13-2019 09:28 AM
GregoryBologna
Occasional Contributor II

I am using a popup to display a sales price and other fields. I want to format the sales price using an arcade expression in an expressionInfos section. I want this format: Text(Number($feature.SALE_PRICE, 0), '$###,###.##') but it's not working.

content = 

   "<div><span class='pao-black'>sale price:</span><span class='pao-blue'> {expression/sale-price}</span></div>"


var popupTemplate = {
      title: "<div>aaa</div>",
      content: content,
      actions: [goToxxx],
      expressionInfos: [{
      name: "sale-price",

         expression: $feature.SALE_PRICE // outputs value

       // expression: "Number($feature.SALE_PRICE, 0)" // strangly, this does not work

       // expression: "Number($feature.SALE_PRICE * 1, 0)" // but this does not work
       // expression: "Text($feature.SALE_PRICE, '$###,###.##')" // outputs value but does not format

       // expression: "Text(Number($feature.SALE_PRICE, 0), '$###,###.##')" // does not format
   }]
};

Tags (2)
0 Kudos
1 Reply
KenBuja
MVP Esteemed Contributor

This expression works properly in the Arcade playground when using a number value

return "$" + Text(Number($feature.SALE_PRICE), ',###.00')‍‍‍