<?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: Conditional Calculation with pulldata @layer in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/conditional-calculation-with-pulldata-layer/m-p/1405560#M55962</link>
    <description>&lt;P&gt;Break it out into two lines?&amp;nbsp; Stash your pulldata result in a hidden question.&amp;nbsp; Set the default to the same "" you get when it fails to return.&amp;nbsp; Then on the next line, the address your going to display just use a if to look at that hidden.&lt;/P&gt;&lt;P&gt;Pretty sure you could also just nest your pulldata into the if but I like the readablity of more lines.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Apr 2024 03:16:42 GMT</pubDate>
    <dc:creator>DuncanC</dc:creator>
    <dc:date>2024-04-04T03:16:42Z</dc:date>
    <item>
      <title>Conditional Calculation with pulldata @layer</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/conditional-calculation-with-pulldata-layer/m-p/1405436#M55958</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to do some conditional calculating. I have an address field in my survey and I'm using pulldata&amp;nbsp;@layer to get the address of a parcel that the point is placed on.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the point is not placed on a parcel, I'd like to return a piece of text like "No Address Found" or something.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My actual pulldata is working fine, I get addresses when the point is on a parcel, but I want to set a default value. From what I understand, actually using Default might not work because that only evaluates when the survey is opened, so if I click a point that isn't on an address, then the default is overwritten with nothing.&lt;/P&gt;&lt;P&gt;pulldata("@layer", "getValueAt", "attributes.ADDRESS", "&amp;lt;parcel REST endpoint&amp;gt;", ${EP311_point})&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 20:01:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/conditional-calculation-with-pulldata-layer/m-p/1405436#M55958</guid>
      <dc:creator>ZachBodenner</dc:creator>
      <dc:date>2024-04-03T20:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Calculation with pulldata @layer</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/conditional-calculation-with-pulldata-layer/m-p/1405560#M55962</link>
      <description>&lt;P&gt;Break it out into two lines?&amp;nbsp; Stash your pulldata result in a hidden question.&amp;nbsp; Set the default to the same "" you get when it fails to return.&amp;nbsp; Then on the next line, the address your going to display just use a if to look at that hidden.&lt;/P&gt;&lt;P&gt;Pretty sure you could also just nest your pulldata into the if but I like the readablity of more lines.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 03:16:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/conditional-calculation-with-pulldata-layer/m-p/1405560#M55962</guid>
      <dc:creator>DuncanC</dc:creator>
      <dc:date>2024-04-04T03:16:42Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Calculation with pulldata @layer</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/conditional-calculation-with-pulldata-layer/m-p/1405753#M55972</link>
      <description>&lt;P&gt;Ideally I'd avoid extra lines though I had thought of that option too - do you have an example of the nested If syntax? The Survey123 connect syntax turns me around sometimes.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 14:44:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/conditional-calculation-with-pulldata-layer/m-p/1405753#M55972</guid>
      <dc:creator>ZachBodenner</dc:creator>
      <dc:date>2024-04-04T14:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Calculation with pulldata @layer</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/conditional-calculation-with-pulldata-layer/m-p/1405789#M55975</link>
      <description>&lt;P&gt;The example for if is:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if(selected(${question_one}, 'yes') and selected(${question_two}, 'yes'), 'yes', 'no')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;So you'd want something like&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if($raw='', 'No Address Found', $raw)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Or to smash it all together:&lt;BR /&gt;if(pulldata("@layer", "getValueAt", "attributes.ADDRESS", "&amp;lt;parcel REST endpoint&amp;gt;", ${EP311_point})='', 'No Address Found', pulldata("@layer", "getValueAt", "attributes.ADDRESS", "&amp;lt;parcel REST endpoint&amp;gt;", ${EP311_point}))&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Yuck.&amp;nbsp; You come back to that in 6 months there is nothing you can do with it but pull it apart.&amp;nbsp; That's a pain.&amp;nbsp; Do future you a solid and try out the extra lines.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also yeah, I do not like the XLSforms syntax, don't end up using it quite enough to ever fully feel comfortable with it,&amp;nbsp; won't surprise me if it needs a little tweaking to work.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 15:23:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/conditional-calculation-with-pulldata-layer/m-p/1405789#M55975</guid>
      <dc:creator>DuncanC</dc:creator>
      <dc:date>2024-04-04T15:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Calculation with pulldata @layer</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/conditional-calculation-with-pulldata-layer/m-p/1405822#M55978</link>
      <description>&lt;P&gt;Yes, that is indeed cumbersome but with one minor tweak it does in fact work:&lt;/P&gt;&lt;P&gt;if(string-length(pulldata("@layer", "getValueAt", "attributes.ADDRESS", "&lt;A href="https://gis.edenprairie.org/maps/rest/services/Public/Parcels/MapServer/0" target="_blank"&gt;https://gis.edenprairie.org/maps/rest/services/Public/Parcels/MapServer/0&lt;/A&gt;", ${EP311_point})&amp;gt;0),'No Address Found',pulldata("@layer", "getValueAt", "attributes.ADDRESS", "&lt;A href="https://gis.edenprairie.org/maps/rest/services/Public/Parcels/MapServer/0" target="_blank"&gt;https://gis.edenprairie.org/maps/rest/services/Public/Parcels/MapServer/0&lt;/A&gt;", ${EP311_point}))&lt;/P&gt;&lt;P&gt;For some reason the empty quotes didn't get it done, but comparing against the return string length did the trick.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 15:40:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/conditional-calculation-with-pulldata-layer/m-p/1405822#M55978</guid>
      <dc:creator>ZachBodenner</dc:creator>
      <dc:date>2024-04-04T15:40:33Z</dc:date>
    </item>
  </channel>
</rss>

