<?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 pad zeros in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/pad-zeros/m-p/508148#M3467</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to insert a link into a pop up to a map about regional transit services. The url for all routes less than 100 have one or two zeros in front of the route number, ie 001 or 055. However, the route column on the attribute table only has the route number ie 1 or 55. Therefore, when I set the link to {Route} routes less then 100 come back with a 404 error. Is there anyway I can use an expression to pad it out with zeros or find another way to navigate around this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note, this live open data from our regional transit provider so I can't generate a a new column with the padded out route numbers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Apr 2018 17:27:32 GMT</pubDate>
    <dc:creator>ChristianRegosch</dc:creator>
    <dc:date>2018-04-03T17:27:32Z</dc:date>
    <item>
      <title>pad zeros</title>
      <link>https://community.esri.com/t5/developers-questions/pad-zeros/m-p/508148#M3467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to insert a link into a pop up to a map about regional transit services. The url for all routes less than 100 have one or two zeros in front of the route number, ie 001 or 055. However, the route column on the attribute table only has the route number ie 1 or 55. Therefore, when I set the link to {Route} routes less then 100 come back with a 404 error. Is there anyway I can use an expression to pad it out with zeros or find another way to navigate around this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note, this live open data from our regional transit provider so I can't generate a a new column with the padded out route numbers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Apr 2018 17:27:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/pad-zeros/m-p/508148#M3467</guid>
      <dc:creator>ChristianRegosch</dc:creator>
      <dc:date>2018-04-03T17:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: pad zeros</title>
      <link>https://community.esri.com/t5/developers-questions/pad-zeros/m-p/508149#M3468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;var myRoute = &amp;lt;your route field&amp;gt;&lt;/P&gt;&lt;P&gt;If Count(myRoute) == 1 {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;return concatenate('00',myRoute)&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;else {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;If Count(myRoute) == 2 {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return concatenate('0',myRoute)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;else {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return myRoute&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plug the returned myRoute variable back into your URL.......Or, something like that. P.S. maybe add another "if" condition for properly formed routes, i.e. check for "Count(myRoute) == 3" just to make sure you are working with clean data.&lt;/P&gt;&lt;P&gt;Anyway, literally learning Arcade today and thought I'd take a crack at your question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Apr 2018 21:33:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/pad-zeros/m-p/508149#M3468</guid>
      <dc:creator>DanielSereno</dc:creator>
      <dc:date>2018-04-08T21:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: pad zeros</title>
      <link>https://community.esri.com/t5/developers-questions/pad-zeros/m-p/508150#M3469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are using python to construct your string there is a nifty function called zfill().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;myText &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"9"&lt;/SPAN&gt;
myNewText &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; myText&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;zfill&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# creates 009&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; myNewText&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:16:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/pad-zeros/m-p/508150#M3469</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2021-12-11T22:16:19Z</dc:date>
    </item>
  </channel>
</rss>

