<?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>idea Use of f-strings in GP Tools Share As WebTool in ArcGIS Pro Ideas</title>
    <link>https://community.esri.com/t5/arcgis-pro-ideas/use-of-f-strings-in-gp-tools-share-as-webtool/idi-p/1473633</link>
    <description>&lt;P&gt;Enable the use of Python f-strings to assemble paths to data sources.&lt;/P&gt;&lt;P&gt;Currently if I use Python f-strings to assemble paths to data sources, the GP Tool runs fine, but when publishing this GP tool through Share as WebTool, the Analyze process will trow en error:&lt;/P&gt;&lt;H1&gt;&amp;nbsp;&lt;/H1&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;00068: Result &amp;lt;value&amp;gt; contains broken project data source: &amp;lt;value&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H1&gt;&lt;FONT size="3"&gt;For example:&lt;/FONT&gt;&lt;/H1&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;folder = "c:/temp"
fdgb = "test.gdb"
fc_name = "my_example"

ds = f"{folder}/{fgdb}/{fc_name}"
if arcpy.Exists(ds):
    arcpy.management.Delete(ds)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently, as suggested in Article ID:&amp;nbsp;000022882, a work-around could be to replace the / in the string literal with ? and then use .replace('?',"/)" to fool the Analyze process.&lt;/P&gt;&lt;P&gt;Instead of relying on this work-around,&amp;nbsp; it would be much cleaner to have the f-strings properly supported when using the Share As WebTool, as they are the preferred way of string formatting in current Python 3.x versions&lt;/P&gt;</description>
    <pubDate>Tue, 11 Mar 2025 23:31:11 GMT</pubDate>
    <dc:creator>tempMarcHoogerwerf_EsriNL</dc:creator>
    <dc:date>2025-03-11T23:31:11Z</dc:date>
    <item>
      <title>Use of f-strings in GP Tools Share As WebTool</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/use-of-f-strings-in-gp-tools-share-as-webtool/idi-p/1473633</link>
      <description>&lt;P&gt;Enable the use of Python f-strings to assemble paths to data sources.&lt;/P&gt;&lt;P&gt;Currently if I use Python f-strings to assemble paths to data sources, the GP Tool runs fine, but when publishing this GP tool through Share as WebTool, the Analyze process will trow en error:&lt;/P&gt;&lt;H1&gt;&amp;nbsp;&lt;/H1&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;00068: Result &amp;lt;value&amp;gt; contains broken project data source: &amp;lt;value&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H1&gt;&lt;FONT size="3"&gt;For example:&lt;/FONT&gt;&lt;/H1&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;folder = "c:/temp"
fdgb = "test.gdb"
fc_name = "my_example"

ds = f"{folder}/{fgdb}/{fc_name}"
if arcpy.Exists(ds):
    arcpy.management.Delete(ds)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently, as suggested in Article ID:&amp;nbsp;000022882, a work-around could be to replace the / in the string literal with ? and then use .replace('?',"/)" to fool the Analyze process.&lt;/P&gt;&lt;P&gt;Instead of relying on this work-around,&amp;nbsp; it would be much cleaner to have the f-strings properly supported when using the Share As WebTool, as they are the preferred way of string formatting in current Python 3.x versions&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 23:31:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/use-of-f-strings-in-gp-tools-share-as-webtool/idi-p/1473633</guid>
      <dc:creator>tempMarcHoogerwerf_EsriNL</dc:creator>
      <dc:date>2025-03-11T23:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: Use of f-strings in GP Tools Share As WebTool - Status changed to: Closed</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/use-of-f-strings-in-gp-tools-share-as-webtool/idc-p/1594560#M34108</link>
      <description>&lt;P&gt;This was more of a defect, so I am closing it as such. Pro 3.5 has improved parsing of Python scripts for swizzling data path strings. The f string pattern shown above will no longer raise an error. The folder variable will be updated by the consolidation swizzling, and the full contents of the c:\temp directory would be uploaded to the server during publishing of the web tool.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 23:33:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/use-of-f-strings-in-gp-tools-share-as-webtool/idc-p/1594560#M34108</guid>
      <dc:creator>DrewFlater</dc:creator>
      <dc:date>2025-03-11T23:33:54Z</dc:date>
    </item>
  </channel>
</rss>

