<?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 Automatically include current weather conditions for new features in ArcGIS Field Maps Questions</title>
    <link>https://community.esri.com/t5/arcgis-field-maps-questions/automatically-include-current-weather-conditions/m-p/1192082#M4081</link>
    <description>&lt;P&gt;Someone at the showcase today asked about having Field Maps automatically include the current weather conditions for newly created features. Here's what I came up with.&lt;/P&gt;&lt;P&gt;Add the service&amp;nbsp;&lt;A href="https://www.arcgis.com/home/item.html?id=cb1886ff0a9d4156ba4d2fadd7e8a139#" target="_blank" rel="noopener"&gt;Current Weather and Wind Station Data&lt;/A&gt;&amp;nbsp;to your map.&lt;/P&gt;&lt;P&gt;Add a text field to your layer to store the weather conditions.&lt;/P&gt;&lt;P&gt;Using Field Maps web, create a calculated expression for the field and use this Arcade expression:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var searchArea = Buffer($feature, 25, 'miles')
var stations = Contains(searchArea, FeatureSetByName($map, 'Stations'))

var closest = null
var minDistance = Infinity

for (var next in stations) {
  var nextDistance = Distance($feature, next)

  if (nextDistance &amp;lt; minDistance) {
      closest = next
      minDistance = nextDistance
  }
}

if (IsEmpty(closest)) {
    return null
}

return Text(closest['TEMP'], '#') + 'º F, ' + closest['SKY_CONDTN'] + ', Wind: ' + closest['WIND_SPEED'] + 'km/h'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are a number of other attributes with interesting information so feel free to customize as you see fit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Jul 2022 23:51:14 GMT</pubDate>
    <dc:creator>jeffj</dc:creator>
    <dc:date>2022-07-13T23:51:14Z</dc:date>
    <item>
      <title>Automatically include current weather conditions for new features</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/automatically-include-current-weather-conditions/m-p/1192082#M4081</link>
      <description>&lt;P&gt;Someone at the showcase today asked about having Field Maps automatically include the current weather conditions for newly created features. Here's what I came up with.&lt;/P&gt;&lt;P&gt;Add the service&amp;nbsp;&lt;A href="https://www.arcgis.com/home/item.html?id=cb1886ff0a9d4156ba4d2fadd7e8a139#" target="_blank" rel="noopener"&gt;Current Weather and Wind Station Data&lt;/A&gt;&amp;nbsp;to your map.&lt;/P&gt;&lt;P&gt;Add a text field to your layer to store the weather conditions.&lt;/P&gt;&lt;P&gt;Using Field Maps web, create a calculated expression for the field and use this Arcade expression:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var searchArea = Buffer($feature, 25, 'miles')
var stations = Contains(searchArea, FeatureSetByName($map, 'Stations'))

var closest = null
var minDistance = Infinity

for (var next in stations) {
  var nextDistance = Distance($feature, next)

  if (nextDistance &amp;lt; minDistance) {
      closest = next
      minDistance = nextDistance
  }
}

if (IsEmpty(closest)) {
    return null
}

return Text(closest['TEMP'], '#') + 'º F, ' + closest['SKY_CONDTN'] + ', Wind: ' + closest['WIND_SPEED'] + 'km/h'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are a number of other attributes with interesting information so feel free to customize as you see fit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 23:51:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/automatically-include-current-weather-conditions/m-p/1192082#M4081</guid>
      <dc:creator>jeffj</dc:creator>
      <dc:date>2022-07-13T23:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically include current weather conditions for new features</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/automatically-include-current-weather-conditions/m-p/1253278#M5248</link>
      <description>&lt;P&gt;This is awesome Jeff! Do you know whether this would need to be modified to populate a field in a related table (insepction table) connected to the feature class?&lt;/P&gt;&lt;P&gt;We'd be adding a new related record (eg daily inspection) and not a new feature in this use case.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2023 13:53:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/automatically-include-current-weather-conditions/m-p/1253278#M5248</guid>
      <dc:creator>AlexVideka</dc:creator>
      <dc:date>2023-01-31T13:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically include current weather conditions for new features</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/automatically-include-current-weather-conditions/m-p/1286998#M5944</link>
      <description>&lt;P&gt;Hi Alex,&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Were you able to find any information about your question on the related table?&amp;nbsp; I am looking for the exact same thing!&amp;nbsp; Thank you,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Darin&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2023 20:46:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/automatically-include-current-weather-conditions/m-p/1286998#M5944</guid>
      <dc:creator>DarinVanDeBerg</dc:creator>
      <dc:date>2023-05-08T20:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically include current weather conditions for new features</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/automatically-include-current-weather-conditions/m-p/1288114#M5977</link>
      <description>&lt;P&gt;Hi Darin,&lt;BR /&gt;&lt;BR /&gt;Unfortunately, I have not yet had a chance to test out Jeff's solution on related tables. This was a 'nice to have' improvement and has been backlogged for the time being. If you are able to get this going, I'd love to know more!&lt;BR /&gt;&lt;BR /&gt;Alex&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2023 13:03:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/automatically-include-current-weather-conditions/m-p/1288114#M5977</guid>
      <dc:creator>AlexVideka</dc:creator>
      <dc:date>2023-05-11T13:03:40Z</dc:date>
    </item>
  </channel>
</rss>

