<?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 Using f-string in `item_properties` in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/using-f-string-in-item-properties/m-p/1123950#M6884</link>
    <description>&lt;P&gt;I cannot seem to use f-string and/or string variable in `item_properties` when I want to publish an item (GeoJSON in this case).&lt;/P&gt;&lt;P&gt;Here is what I have:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;region = "Gulf of Mexico"
gis = GIS(username=USERNAME, password=PASSWORD)

data_path = "/path/to/data.json"
title = f"Objects in {region}"
item_properties = {"type": "GeoJson",
"title": title,
"tags": "object detection"}
item = gis.content.add(item_properties=item_properties, data=data_path)
publishedCollection = item.publish(file_type='geojson')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The use of a string variable gives me a `KeyError: 'type'` when I attempt to publish the item.&lt;BR /&gt;&lt;BR /&gt;The `KeyError` would go away, however, if I use the following `item_properties`:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;item_properties = {"type": "GeoJson",
"title": "Objects in Gulf of Mexico",
"tags": "object detection"}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this a known issue? I would like to programmatically set the title; is there a way around the inability to use a string variable/f-string?&lt;/P&gt;</description>
    <pubDate>Wed, 08 Dec 2021 18:23:10 GMT</pubDate>
    <dc:creator>timatcambrio</dc:creator>
    <dc:date>2021-12-08T18:23:10Z</dc:date>
    <item>
      <title>Using f-string in `item_properties`</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/using-f-string-in-item-properties/m-p/1123950#M6884</link>
      <description>&lt;P&gt;I cannot seem to use f-string and/or string variable in `item_properties` when I want to publish an item (GeoJSON in this case).&lt;/P&gt;&lt;P&gt;Here is what I have:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;region = "Gulf of Mexico"
gis = GIS(username=USERNAME, password=PASSWORD)

data_path = "/path/to/data.json"
title = f"Objects in {region}"
item_properties = {"type": "GeoJson",
"title": title,
"tags": "object detection"}
item = gis.content.add(item_properties=item_properties, data=data_path)
publishedCollection = item.publish(file_type='geojson')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The use of a string variable gives me a `KeyError: 'type'` when I attempt to publish the item.&lt;BR /&gt;&lt;BR /&gt;The `KeyError` would go away, however, if I use the following `item_properties`:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;item_properties = {"type": "GeoJson",
"title": "Objects in Gulf of Mexico",
"tags": "object detection"}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this a known issue? I would like to programmatically set the title; is there a way around the inability to use a string variable/f-string?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 18:23:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/using-f-string-in-item-properties/m-p/1123950#M6884</guid>
      <dc:creator>timatcambrio</dc:creator>
      <dc:date>2021-12-08T18:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using f-string in `item_properties`</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/using-f-string-in-item-properties/m-p/1123955#M6885</link>
      <description>&lt;P&gt;It turns out that it was not the f-string that was the issue. It appears there might be a character limit to the title of the Feature Layer that was causing the problem.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 18:38:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/using-f-string-in-item-properties/m-p/1123955#M6885</guid>
      <dc:creator>timatcambrio</dc:creator>
      <dc:date>2021-12-08T18:38:06Z</dc:date>
    </item>
  </channel>
</rss>

