<?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 Basic substr string parsing question in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/basic-substr-string-parsing-question/m-p/866652#M27138</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using select_one that returns a string containing a&amp;nbsp; number (unknown number of digits) followed by a '-' followed by a text string. How do I use substr to parse out the number before the '-'.&amp;nbsp; It can be any number between 1 and 999.&lt;/P&gt;&lt;P&gt;For example "10-Lincoln Center Parkway" I just want to use the number 10 in pulldata call to look up additional information.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Dec 2019 23:42:45 GMT</pubDate>
    <dc:creator>LS1</dc:creator>
    <dc:date>2019-12-18T23:42:45Z</dc:date>
    <item>
      <title>Basic substr string parsing question</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/basic-substr-string-parsing-question/m-p/866652#M27138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using select_one that returns a string containing a&amp;nbsp; number (unknown number of digits) followed by a '-' followed by a text string. How do I use substr to parse out the number before the '-'.&amp;nbsp; It can be any number between 1 and 999.&lt;/P&gt;&lt;P&gt;For example "10-Lincoln Center Parkway" I just want to use the number 10 in pulldata call to look up additional information.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Dec 2019 23:42:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/basic-substr-string-parsing-question/m-p/866652#M27138</guid>
      <dc:creator>LS1</dc:creator>
      <dc:date>2019-12-18T23:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: Basic substr string parsing question</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/basic-substr-string-parsing-question/m-p/866653#M27139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lisa&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One way to achieve this would be to use substr() with nested if statements. Luckily in this case you only have three scenarios (i.e. one-, two- or three-digit number) so the calculation shouldn't be too cumbersome! Check the postion of the "-" separator to work out how many digits, then return the first 1, 2 or 3 characters as applicable. For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;if((substr(${address1},1,2)='-'),substr(${address1},0,1),if((substr(${address1},2,3)='-'),substr(${address1},0,2),if((substr(${address1},3,4)='-'),substr(${address1},0,3),'')))&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively, you could use regular expressions in each if statement to match the pattern. For more info on regex please see:&amp;nbsp;&lt;A class="link-titled" href="https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm#ESRI_SECTION1_8979CBF8B7354DA9A4FE0F6B6D61E1A0" title="https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm#ESRI_SECTION1_8979CBF8B7354DA9A4FE0F6B6D61E1A0"&gt;Formulas—Survey123 for ArcGIS | Documentation&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Jim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Dec 2019 06:47:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/basic-substr-string-parsing-question/m-p/866653#M27139</guid>
      <dc:creator>Jim-Moore</dc:creator>
      <dc:date>2019-12-19T06:47:00Z</dc:date>
    </item>
  </channel>
</rss>

