<?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 Set JSON data for Web Mapping Application item in AGOL in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/set-json-data-for-web-mapping-application-item-in/m-p/1193036#M47009</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I am trying to upload a definition for a Web Mapping Application to ArcGIS Online using arcgis.gis. I have a .json file "testWebMappingApplication.json" where I have defined the data for the app. The problem I am running into is that when I check the item in ArcGIS Online Assistant, I see the description JSON but nothing for data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;workspace =  os.path.dirname(os.path.abspath("__file__"))
input_file_name = workspace + r'\testWebMappingApplication.json'

with open(input_file_name) as input_file:
    print('reading {}'.format(input_file_name))
    json_input = input_file.read()
    
default_obj = json.loads(json_input)


ip = {
    "title": "WEBAPP_PYTHONTEST",
    "type": "Web Mapping Application",
    "typeKeywords": [
        "JavaScript",
        "Map",
        "Mapping Site",
        "Online Map",
        "Ready To Use",
        "WAB2D",
        "Web AppBuilder",
        "Web Map"
    ]
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried several approaches ways of calling gis.content.add:&lt;/SPAN&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# gis.content.add(item_properties=ip, folder="DevTest", data=default_obj) # error
# item = gis.content.add(item_properties=ip, folder="DevTest") # works but no data
# item = gis.content.add(item_properties=ip, folder="DevTest", data=json.dumps(default_obj)) # error
item = gis.content.add(item_properties=ip, folder="DevTest", data=input_file_name) # works but no data in ArcGIS Online Assistant&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;The last line doesn't give an error but in ArcGIS Online Assistant I don't see the data JSON, instead there is a link to download the file. Is there a way to set the JSON data for the Web Mapping Application item?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 18 Jul 2022 17:46:14 GMT</pubDate>
    <dc:creator>VincentLantaca</dc:creator>
    <dc:date>2022-07-18T17:46:14Z</dc:date>
    <item>
      <title>Set JSON data for Web Mapping Application item in AGOL</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/set-json-data-for-web-mapping-application-item-in/m-p/1193036#M47009</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I am trying to upload a definition for a Web Mapping Application to ArcGIS Online using arcgis.gis. I have a .json file "testWebMappingApplication.json" where I have defined the data for the app. The problem I am running into is that when I check the item in ArcGIS Online Assistant, I see the description JSON but nothing for data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;workspace =  os.path.dirname(os.path.abspath("__file__"))
input_file_name = workspace + r'\testWebMappingApplication.json'

with open(input_file_name) as input_file:
    print('reading {}'.format(input_file_name))
    json_input = input_file.read()
    
default_obj = json.loads(json_input)


ip = {
    "title": "WEBAPP_PYTHONTEST",
    "type": "Web Mapping Application",
    "typeKeywords": [
        "JavaScript",
        "Map",
        "Mapping Site",
        "Online Map",
        "Ready To Use",
        "WAB2D",
        "Web AppBuilder",
        "Web Map"
    ]
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried several approaches ways of calling gis.content.add:&lt;/SPAN&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# gis.content.add(item_properties=ip, folder="DevTest", data=default_obj) # error
# item = gis.content.add(item_properties=ip, folder="DevTest") # works but no data
# item = gis.content.add(item_properties=ip, folder="DevTest", data=json.dumps(default_obj)) # error
item = gis.content.add(item_properties=ip, folder="DevTest", data=input_file_name) # works but no data in ArcGIS Online Assistant&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;The last line doesn't give an error but in ArcGIS Online Assistant I don't see the data JSON, instead there is a link to download the file. Is there a way to set the JSON data for the Web Mapping Application item?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2022 17:46:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/set-json-data-for-web-mapping-application-item-in/m-p/1193036#M47009</guid>
      <dc:creator>VincentLantaca</dc:creator>
      <dc:date>2022-07-18T17:46:14Z</dc:date>
    </item>
  </channel>
</rss>

