<?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 Re: Attribute rule not applying with hosted feature service? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-not-applying-with-hosted-feature/m-p/1104598#M46342</link>
    <description>&lt;P&gt;Are you publishing to ArcGIS Online or Enterprise?&lt;/P&gt;</description>
    <pubDate>Mon, 04 Oct 2021 23:58:04 GMT</pubDate>
    <dc:creator>MicZatorsky_AEC</dc:creator>
    <dc:date>2021-10-04T23:58:04Z</dc:date>
    <item>
      <title>Attribute rule not applying with hosted feature service?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-not-applying-with-hosted-feature/m-p/1103942#M46235</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I created and attribute rule where the duration field auto-populates with the following values. It runs perfectly fine locally in ArcGIS Pro, but when I publish the hosted layer with this rule it doesn't seem to work. I would greatly appreciate if any could either help or explain the reasoning for this not working.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var From = Date($feature.OutageStart)
var To = Date($feature.OutageEnd)
var EndTime = Text(To, 'h:mm A')

var LenOfTime_Days = DateDiff(To, From, 'days')
var days = Round(LenOfTime_Days)
var LenOfTime_Hours = DateDiff(To, From, 'hours')
var LenOfTime_Minutes = 60 - Minute(To)

var duration = 'Approximately ' + days + ' day(s) from 9:00 AM - 4:00 PM ending at ' + EndTime + ' on the last day.'

if (LenOfTime_Days &amp;gt;= 1){
return duration
}
else if(LenOfTime_Days &amp;lt; 1 &amp;amp;&amp;amp; LenOfTime_Hours != 0 &amp;amp;&amp;amp; LenOfTime_Minutes == 60){
duration = LenOfTime_Hours + ' hour(s)'
}
else if(LenOfTime_Days &amp;lt; 1 &amp;amp;&amp;amp; LenOfTime_Hours == 0 &amp;amp;&amp;amp; LenOfTime_Minutes != 60){
duration = LenOfTime_Minutes + ' minutes'
}
else if(LenOfTime_Days &amp;lt; 1 &amp;amp;&amp;amp; LenOfTime_Hours != 0 &amp;amp;&amp;amp; LenOfTime_Minutes != 60){
duration = LenOfTime_Hours + ' hour and ' + LenOfTime_Minutes + ' minutes'
}

return duration&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Non-populating field.JPG" style="width: 451px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/24361i9917121722366233/image-size/large?v=v2&amp;amp;px=999" role="button" title="Non-populating field.JPG" alt="Non-populating field.JPG" /&gt;&lt;/span&gt;- Hosted Feature Service in Web Map&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Populating attribute rule.JPG" style="width: 613px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/24363i8D8235E02071A540/image-size/large?v=v2&amp;amp;px=999" role="button" title="Populating attribute rule.JPG" alt="Populating attribute rule.JPG" /&gt;&lt;/span&gt;&amp;nbsp;- ArcGIS Pro&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Oct 2021 14:46:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-not-applying-with-hosted-feature/m-p/1103942#M46235</guid>
      <dc:creator>RPGIS</dc:creator>
      <dc:date>2021-10-01T14:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rule not applying with hosted feature service?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-not-applying-with-hosted-feature/m-p/1104598#M46342</link>
      <description>&lt;P&gt;Are you publishing to ArcGIS Online or Enterprise?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Oct 2021 23:58:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-not-applying-with-hosted-feature/m-p/1104598#M46342</guid>
      <dc:creator>MicZatorsky_AEC</dc:creator>
      <dc:date>2021-10-04T23:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rule not applying with hosted feature service?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-not-applying-with-hosted-feature/m-p/1104851#M46365</link>
      <description>&lt;P&gt;I am publishing this to AGO.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 15:55:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-not-applying-with-hosted-feature/m-p/1104851#M46365</guid>
      <dc:creator>RPGIS</dc:creator>
      <dc:date>2021-10-05T15:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rule not applying with hosted feature service?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-not-applying-with-hosted-feature/m-p/1105383#M46420</link>
      <description>&lt;P&gt;"&lt;EM&gt;Currently, attribute rules are not supported in hosted feature layers in ArcGIS Online.&lt;/EM&gt;"&lt;BR /&gt;&lt;A href="https://community.esri.com/t5/attribute-rules-documents/attribute-rule-faq/ta-p/910439#toc-hId-423732927" target="_blank"&gt;https://community.esri.com/t5/attribute-rules-documents/attribute-rule-faq/ta-p/910439#toc-hId-423732927&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 22:50:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-not-applying-with-hosted-feature/m-p/1105383#M46420</guid>
      <dc:creator>MicZatorsky_AEC</dc:creator>
      <dc:date>2021-10-06T22:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rule not applying with hosted feature service?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-not-applying-with-hosted-feature/m-p/1105908#M46475</link>
      <description>&lt;P&gt;I think they are supported or there is something else that is happening in the background that is occurring. I have a hosted feature service, and the service is currently working where the attribute value changes according to the rule that I set up.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 14:28:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-not-applying-with-hosted-feature/m-p/1105908#M46475</guid>
      <dc:creator>RPGIS</dc:creator>
      <dc:date>2021-10-08T14:28:16Z</dc:date>
    </item>
  </channel>
</rss>

