<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Arcade Table Not Running Function in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-table-not-running-function/m-p/1555446#M10453</link>
    <description>&lt;P&gt;Hello all, good morning, hope all is well &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;, so I have added three functions in an Arcade script for a table.&lt;/P&gt;&lt;P&gt;The script itself is not flagging any errors, but the output window say "Unable to execute Arcade script"&lt;/P&gt;&lt;P&gt;How can I fix this?&lt;/P&gt;&lt;P&gt;Whole code:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// Color severity values
function returnColorS(value){
  return When(
    value == "Minor", "#dedede",
    value == "Significant", "#C1C1C1",
    value == "Major", "#D18E8E",
    value == "Severe", "#D17578",
  )
}

function showIconS(value){
  return IIF(value == "Severe", "Alert",'')
}

function showIconL(value){
  return IIF(value == "Likely", "Alert",'')
}

return {
  cells: {
    name: {
      displayText : $datapoint.name,
      textColor: '',
      backgroundColor: '',
      textAlign: 'left',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    home_address: {
      displayText : $datapoint.home_address,
      textColor: '',
      backgroundColor: '',
      textAlign: 'left',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    cell_phone: {
      displayText : $datapoint.cell_phone,
      textColor: '',
      backgroundColor: '',
      textAlign: 'left',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    email_address: {
      displayText : $datapoint.email_address,
      textColor: '',
      backgroundColor: '',
      textAlign: 'left',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    date_and_time: {
      displayText : Text($datapoint.date_and_time),
      textColor: '',
      backgroundColor: '',
      textAlign: 'left',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    who_is_submitting_the_potential: {
      displayText : $datapoint.who_is_submitting_the_potential,
      textColor: '',
      backgroundColor: '',
      textAlign: 'left',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    what_government_level: {
      displayText : $datapoint.what_government_level,
      textColor: '',
      backgroundColor: '',
      textAlign: 'left',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    what_kind_of_hazard_are_you_rep: {
      displayText : $datapoint.what_kind_of_hazard_are_you_rep,
      textColor: '',
      backgroundColor: '',
      textAlign: 'left',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    please_specify_the_type_of_haza: {
      displayText : $datapoint.please_specify_the_type_of_haza,
      textColor: '',
      backgroundColor: '',
      textAlign: 'left',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    how_severe_could_the_injury_to: {
      displayText : $datapoint.how_severe_could_the_injury_to,
      textColor: '',
      backgroundColor: returnColorS($datapoint.how_severe_could_the_injury_to),
      textAlign: 'left',
      iconName: showIconS($datapoint.how_severe_could_the_injury_to),
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },

    what_is_the_probability_that_in: {
      displayText : $datapoint.what_is_the_probability_that_in,
      textColor: '',
      backgroundColor: '',
      textAlign: 'left',
      iconName: showIconL($datapoint.what_is_the_probability_that_in),
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Functions and where there are being used in the script:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// Color severity values
function returnColorS(value){
  return When(
    value == "Minor", "#dedede",
    value == "Significant", "#C1C1C1",
    value == "Major", "#D18E8E",
    value == "Severe", "#D17578",
  )
}

function showIconS(value){
  return IIF(value == "Severe", "Alert",'')
}

function showIconL(value){
  return IIF(value == "Likely", "Alert",'')
}


how_severe_could_the_injury_to: {
      displayText : $datapoint.how_severe_could_the_injury_to,
      textColor: '',
      backgroundColor: returnColorS($datapoint.how_severe_could_the_injury_to),
      textAlign: 'left',
      iconName: showIconS($datapoint.how_severe_could_the_injury_to),
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },

    what_is_the_probability_that_in: {
      displayText : $datapoint.what_is_the_probability_that_in,
      textColor: '',
      backgroundColor: '',
      textAlign: 'left',
      iconName: showIconL($datapoint.what_is_the_probability_that_in),
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Nov 2024 15:53:08 GMT</pubDate>
    <dc:creator>Ed_</dc:creator>
    <dc:date>2024-11-05T15:53:08Z</dc:date>
    <item>
      <title>Arcade Table Not Running Function</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-table-not-running-function/m-p/1555446#M10453</link>
      <description>&lt;P&gt;Hello all, good morning, hope all is well &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;, so I have added three functions in an Arcade script for a table.&lt;/P&gt;&lt;P&gt;The script itself is not flagging any errors, but the output window say "Unable to execute Arcade script"&lt;/P&gt;&lt;P&gt;How can I fix this?&lt;/P&gt;&lt;P&gt;Whole code:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// Color severity values
function returnColorS(value){
  return When(
    value == "Minor", "#dedede",
    value == "Significant", "#C1C1C1",
    value == "Major", "#D18E8E",
    value == "Severe", "#D17578",
  )
}

function showIconS(value){
  return IIF(value == "Severe", "Alert",'')
}

function showIconL(value){
  return IIF(value == "Likely", "Alert",'')
}

return {
  cells: {
    name: {
      displayText : $datapoint.name,
      textColor: '',
      backgroundColor: '',
      textAlign: 'left',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    home_address: {
      displayText : $datapoint.home_address,
      textColor: '',
      backgroundColor: '',
      textAlign: 'left',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    cell_phone: {
      displayText : $datapoint.cell_phone,
      textColor: '',
      backgroundColor: '',
      textAlign: 'left',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    email_address: {
      displayText : $datapoint.email_address,
      textColor: '',
      backgroundColor: '',
      textAlign: 'left',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    date_and_time: {
      displayText : Text($datapoint.date_and_time),
      textColor: '',
      backgroundColor: '',
      textAlign: 'left',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    who_is_submitting_the_potential: {
      displayText : $datapoint.who_is_submitting_the_potential,
      textColor: '',
      backgroundColor: '',
      textAlign: 'left',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    what_government_level: {
      displayText : $datapoint.what_government_level,
      textColor: '',
      backgroundColor: '',
      textAlign: 'left',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    what_kind_of_hazard_are_you_rep: {
      displayText : $datapoint.what_kind_of_hazard_are_you_rep,
      textColor: '',
      backgroundColor: '',
      textAlign: 'left',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    please_specify_the_type_of_haza: {
      displayText : $datapoint.please_specify_the_type_of_haza,
      textColor: '',
      backgroundColor: '',
      textAlign: 'left',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
    how_severe_could_the_injury_to: {
      displayText : $datapoint.how_severe_could_the_injury_to,
      textColor: '',
      backgroundColor: returnColorS($datapoint.how_severe_could_the_injury_to),
      textAlign: 'left',
      iconName: showIconS($datapoint.how_severe_could_the_injury_to),
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },

    what_is_the_probability_that_in: {
      displayText : $datapoint.what_is_the_probability_that_in,
      textColor: '',
      backgroundColor: '',
      textAlign: 'left',
      iconName: showIconL($datapoint.what_is_the_probability_that_in),
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
		
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Functions and where there are being used in the script:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// Color severity values
function returnColorS(value){
  return When(
    value == "Minor", "#dedede",
    value == "Significant", "#C1C1C1",
    value == "Major", "#D18E8E",
    value == "Severe", "#D17578",
  )
}

function showIconS(value){
  return IIF(value == "Severe", "Alert",'')
}

function showIconL(value){
  return IIF(value == "Likely", "Alert",'')
}


how_severe_could_the_injury_to: {
      displayText : $datapoint.how_severe_could_the_injury_to,
      textColor: '',
      backgroundColor: returnColorS($datapoint.how_severe_could_the_injury_to),
      textAlign: 'left',
      iconName: showIconS($datapoint.how_severe_could_the_injury_to),
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },

    what_is_the_probability_that_in: {
      displayText : $datapoint.what_is_the_probability_that_in,
      textColor: '',
      backgroundColor: '',
      textAlign: 'left',
      iconName: showIconL($datapoint.what_is_the_probability_that_in),
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 15:53:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-table-not-running-function/m-p/1555446#M10453</guid>
      <dc:creator>Ed_</dc:creator>
      <dc:date>2024-11-05T15:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Table Not Running Function</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-table-not-running-function/m-p/1555447#M10454</link>
      <description>&lt;P&gt;Good morning&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;&amp;nbsp;hope all is well, any help with this will really appreciated, cheers&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 15:54:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-table-not-running-function/m-p/1555447#M10454</guid>
      <dc:creator>Ed_</dc:creator>
      <dc:date>2024-11-05T15:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Table Not Running Function</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-table-not-running-function/m-p/1555472#M10455</link>
      <description>&lt;P&gt;One issue is the When function doesn't have a default value. When I remove that from my test, I get the "Unable to execute" message&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function returnColorS(value){
  When(
    value == "Minor", "#dedede",
    value == "Significant", "#C1C1C1",
    value == "Major", "#D18E8E",
    value == "Severe", "#D17578",
    "#f00000"
  );
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snag_5270ac.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/118870i4111EF41344F7F8D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Snag_5270ac.png" alt="Snag_5270ac.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 16:24:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-table-not-running-function/m-p/1555472#M10455</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-11-05T16:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Table Not Running Function</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-table-not-running-function/m-p/1555487#M10456</link>
      <description>&lt;P&gt;yup that worked like charm&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; you are the best&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; thank you for the super quick response&amp;nbsp;&lt;/P&gt;&lt;P&gt;have a nice day and week ahead&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 16:36:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-table-not-running-function/m-p/1555487#M10456</guid>
      <dc:creator>Ed_</dc:creator>
      <dc:date>2024-11-05T16:36:17Z</dc:date>
    </item>
  </channel>
</rss>

