<?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 Restricting a radio button/switch based on proximity to a map point in ArcGIS Field Maps Questions</title>
    <link>https://community.esri.com/t5/arcgis-field-maps-questions/restricting-a-radio-button-switch-based-on/m-p/1410663#M8368</link>
    <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I hope this finds you well.&lt;/P&gt;&lt;P&gt;I'm working on a Fieldmaps project where I need to restrict the visibility of a radio button or switch based on the user's proximity to a selected point on the map. I want the form to only be active if the user is within 50 meters of the selected point.&lt;/P&gt;&lt;P&gt;I've searched the documentation and forums, but I haven't been able to find a solution for this specific scenario. I've tried using expressions and triggers, but I haven't been able to get it to work as expected.&lt;/P&gt;&lt;P&gt;Any suggestions or guidance would be greatly appreciated.&lt;/P&gt;&lt;P&gt;This is my calculated field in Arcade&lt;/P&gt;&lt;P&gt;Arcade code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Verificar si el radio button es 'Visitado'&lt;BR /&gt;if ($feature.Llegada_al_Cliente == 'Visitado' &amp;amp;&amp;amp; IsEmpty($feature.HoraIni) ) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; // Asignar la hora actual a una variable&lt;BR /&gt;&amp;nbsp; &amp;nbsp; var currentDateTime = Now();&lt;BR /&gt;&amp;nbsp; &amp;nbsp; // Asignar la hora actual al campo 'HoraIni'&lt;BR /&gt;&amp;nbsp; &amp;nbsp; return currentDateTime;&lt;BR /&gt;} else {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; // Si no es 'Visitado', mantener el valor actual del campo 'HoraIni'&lt;BR /&gt;&amp;nbsp; &amp;nbsp; return $feature.HoraIni;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;This is my idea, but it gives me an error.&lt;/P&gt;&lt;P&gt;// Verificar si el radio button es 'Visitado' y si la distancia al punto es menor a 50 metros&lt;BR /&gt;if ($feature.Llegada_al_Cliente == 'Visitado' &amp;amp;&amp;amp; Distance($feature.location, $geometry) &amp;lt; 50) {&lt;BR /&gt;// Asignar la hora actual a una variable&lt;BR /&gt;var currentDateTime = Now();&lt;BR /&gt;// Asignar la hora actual al campo 'HoraIni'&lt;BR /&gt;return currentDateTime;&lt;BR /&gt;} else {&lt;BR /&gt;// Si no es 'Visitado' o la distancia es mayor a 50 metros, mantener el valor actual del campo 'HoraIni'&lt;BR /&gt;return $feature.HoraIni;&lt;BR /&gt;}&lt;BR /&gt;error:&amp;nbsp;&lt;BR /&gt;Invalid property identifier, expecting ObjectId&lt;BR /&gt;error:&amp;nbsp;$feature.location&lt;/P&gt;</description>
    <pubDate>Tue, 16 Apr 2024 21:58:35 GMT</pubDate>
    <dc:creator>WILERMJOSEPERAZAPIMENTEL</dc:creator>
    <dc:date>2024-04-16T21:58:35Z</dc:date>
    <item>
      <title>Restricting a radio button/switch based on proximity to a map point</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/restricting-a-radio-button-switch-based-on/m-p/1410663#M8368</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I hope this finds you well.&lt;/P&gt;&lt;P&gt;I'm working on a Fieldmaps project where I need to restrict the visibility of a radio button or switch based on the user's proximity to a selected point on the map. I want the form to only be active if the user is within 50 meters of the selected point.&lt;/P&gt;&lt;P&gt;I've searched the documentation and forums, but I haven't been able to find a solution for this specific scenario. I've tried using expressions and triggers, but I haven't been able to get it to work as expected.&lt;/P&gt;&lt;P&gt;Any suggestions or guidance would be greatly appreciated.&lt;/P&gt;&lt;P&gt;This is my calculated field in Arcade&lt;/P&gt;&lt;P&gt;Arcade code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Verificar si el radio button es 'Visitado'&lt;BR /&gt;if ($feature.Llegada_al_Cliente == 'Visitado' &amp;amp;&amp;amp; IsEmpty($feature.HoraIni) ) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; // Asignar la hora actual a una variable&lt;BR /&gt;&amp;nbsp; &amp;nbsp; var currentDateTime = Now();&lt;BR /&gt;&amp;nbsp; &amp;nbsp; // Asignar la hora actual al campo 'HoraIni'&lt;BR /&gt;&amp;nbsp; &amp;nbsp; return currentDateTime;&lt;BR /&gt;} else {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; // Si no es 'Visitado', mantener el valor actual del campo 'HoraIni'&lt;BR /&gt;&amp;nbsp; &amp;nbsp; return $feature.HoraIni;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;This is my idea, but it gives me an error.&lt;/P&gt;&lt;P&gt;// Verificar si el radio button es 'Visitado' y si la distancia al punto es menor a 50 metros&lt;BR /&gt;if ($feature.Llegada_al_Cliente == 'Visitado' &amp;amp;&amp;amp; Distance($feature.location, $geometry) &amp;lt; 50) {&lt;BR /&gt;// Asignar la hora actual a una variable&lt;BR /&gt;var currentDateTime = Now();&lt;BR /&gt;// Asignar la hora actual al campo 'HoraIni'&lt;BR /&gt;return currentDateTime;&lt;BR /&gt;} else {&lt;BR /&gt;// Si no es 'Visitado' o la distancia es mayor a 50 metros, mantener el valor actual del campo 'HoraIni'&lt;BR /&gt;return $feature.HoraIni;&lt;BR /&gt;}&lt;BR /&gt;error:&amp;nbsp;&lt;BR /&gt;Invalid property identifier, expecting ObjectId&lt;BR /&gt;error:&amp;nbsp;$feature.location&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2024 21:58:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/restricting-a-radio-button-switch-based-on/m-p/1410663#M8368</guid>
      <dc:creator>WILERMJOSEPERAZAPIMENTEL</dc:creator>
      <dc:date>2024-04-16T21:58:35Z</dc:date>
    </item>
  </channel>
</rss>

