<?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 Re: how to create advanced view with arcgis api for python in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-create-advanced-view-with-arcgis-api-for/m-p/1486631#M10130</link>
    <description>&lt;P&gt;it works, I had to adapt some things I hadn't thought of.&lt;BR /&gt;many thanks&lt;/P&gt;</description>
    <pubDate>Thu, 06 Jun 2024 21:16:55 GMT</pubDate>
    <dc:creator>MatthieuANDRE3</dc:creator>
    <dc:date>2024-06-06T21:16:55Z</dc:date>
    <item>
      <title>how to create advanced view with arcgis api for python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-create-advanced-view-with-arcgis-api-for/m-p/1486313#M10124</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I've had a problem for several days that I can't solve. I want to create an advanced view from 2 hosted views.&lt;BR /&gt;Let me explain:&lt;BR /&gt;I have a hosted feature layer for which I'm creating a view (I'm only interested in certain fields). No problem to create this view.&lt;BR /&gt;I have a hosted table for which I'm creating a view (I'm only interested in certain fields).&amp;nbsp;No problem to create this view.&lt;BR /&gt;&amp;nbsp;For each of these views I use the &lt;STRONG&gt;manager.create_view method&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;My problem is that I can't create a new view from the 2 previous views, whereas I can do it perfectly well from the graphical interface of map viewer classic.&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;join_features&lt;/STRONG&gt; &lt;STRONG&gt;method&lt;/STRONG&gt; doesn't seem to be what I'm looking for because it creates a new independent hosted feature layer (which I don't want).&lt;/P&gt;&lt;P&gt;So I used the &lt;STRONG&gt;method gis.content.create_service(name='xxx', service_type='featureService', is_view=True)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;It seems to work, but I still have to update the layer definition using the &lt;STRONG&gt;fl.manager.update_definition(definition) method&lt;/STRONG&gt; to modify the &lt;STRONG&gt;[layers] tag&lt;/STRONG&gt; in the &lt;STRONG&gt;properties&lt;/STRONG&gt;, and that's where I run into my problem, because I don't know how to make sure my json is properly parameterized.&lt;/P&gt;&lt;P&gt;If you have an idea, I'd love to hear from you.&lt;/P&gt;&lt;P&gt;many thanks in advance.&lt;/P&gt;&lt;P&gt;Translated with DeepL.com (free version)&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2024 15:24:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-create-advanced-view-with-arcgis-api-for/m-p/1486313#M10124</guid>
      <dc:creator>MatthieuANDRE3</dc:creator>
      <dc:date>2024-06-06T15:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to create advanced view with arcgis api for python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-create-advanced-view-with-arcgis-api-for/m-p/1486392#M10126</link>
      <description>&lt;P&gt;Perhaps this will help?&lt;BR /&gt;&lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/joined-view-layer/m-p/1406655/highlight/true#M9845" target="_blank"&gt;Solved: Re: Joined View Layer - Esri Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2024 16:42:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-create-advanced-view-with-arcgis-api-for/m-p/1486392#M10126</guid>
      <dc:creator>EarlMedina</dc:creator>
      <dc:date>2024-06-06T16:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to create advanced view with arcgis api for python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-create-advanced-view-with-arcgis-api-for/m-p/1486567#M10128</link>
      <description>&lt;P&gt;unfortunately I get the following error message when calling the add_to_definition method.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;---------------------------------------------------------------------------&lt;/SPAN&gt;
&lt;SPAN class=""&gt;Exception&lt;/SPAN&gt;                                 Traceback (most recent call last)
&lt;SPAN class=""&gt;/tmp/ipykernel_51/2098146221.py&lt;/SPAN&gt; in &lt;SPAN class=""&gt;&amp;lt;cell line: 120&amp;gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;()&lt;/SPAN&gt;
&lt;SPAN class=""&gt;    118&lt;/SPAN&gt; }
&lt;SPAN class=""&gt;    119&lt;/SPAN&gt; 
&lt;SPAN class=""&gt;--&amp;gt; 120&lt;/SPAN&gt; view_flc&lt;SPAN class=""&gt;.&lt;/SPAN&gt;manager&lt;SPAN class=""&gt;.&lt;/SPAN&gt;add_to_definition&lt;SPAN class=""&gt;(&lt;/SPAN&gt;definition_to_add&lt;SPAN class=""&gt;)&lt;/SPAN&gt;

&lt;SPAN class=""&gt;/opt/conda/lib/python3.9/site-packages/arcgis/features/managers.py&lt;/SPAN&gt; in &lt;SPAN class=""&gt;add_to_definition&lt;/SPAN&gt;&lt;SPAN class=""&gt;(self, json_dict, future)&lt;/SPAN&gt;
&lt;SPAN class=""&gt;   2546&lt;/SPAN&gt;         }
&lt;SPAN class=""&gt;   2547&lt;/SPAN&gt;         adddefn_url &lt;SPAN class=""&gt;=&lt;/SPAN&gt; self&lt;SPAN class=""&gt;.&lt;/SPAN&gt;_url &lt;SPAN class=""&gt;+&lt;/SPAN&gt; &lt;SPAN class=""&gt;"/addToDefinition"&lt;/SPAN&gt;
&lt;SPAN class=""&gt;-&amp;gt; 2548&lt;/SPAN&gt;         res &lt;SPAN class=""&gt;=&lt;/SPAN&gt; self&lt;SPAN class=""&gt;.&lt;/SPAN&gt;_con&lt;SPAN class=""&gt;.&lt;/SPAN&gt;post&lt;SPAN class=""&gt;(&lt;/SPAN&gt;adddefn_url&lt;SPAN class=""&gt;,&lt;/SPAN&gt; params&lt;SPAN class=""&gt;)&lt;/SPAN&gt;
&lt;SPAN class=""&gt;   2549&lt;/SPAN&gt;         &lt;SPAN class=""&gt;if&lt;/SPAN&gt; future &lt;SPAN class=""&gt;and&lt;/SPAN&gt; &lt;SPAN class=""&gt;"statusURL"&lt;/SPAN&gt; &lt;SPAN class=""&gt;in&lt;/SPAN&gt; res&lt;SPAN class=""&gt;:&lt;/SPAN&gt;
&lt;SPAN class=""&gt;   2550&lt;/SPAN&gt;             executor &lt;SPAN class=""&gt;=&lt;/SPAN&gt; _cf&lt;SPAN class=""&gt;.&lt;/SPAN&gt;ThreadPoolExecutor&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;1&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;

&lt;SPAN class=""&gt;/opt/conda/lib/python3.9/site-packages/arcgis/gis/_impl/_con/_connection.py&lt;/SPAN&gt; in &lt;SPAN class=""&gt;post&lt;/SPAN&gt;&lt;SPAN class=""&gt;(self, path, params, files, **kwargs)&lt;/SPAN&gt;
&lt;SPAN class=""&gt;   1522&lt;/SPAN&gt;         &lt;SPAN class=""&gt;if&lt;/SPAN&gt; return_raw_response&lt;SPAN class=""&gt;:&lt;/SPAN&gt;
&lt;SPAN class=""&gt;   1523&lt;/SPAN&gt;             &lt;SPAN class=""&gt;return&lt;/SPAN&gt; resp
&lt;SPAN class=""&gt;-&amp;gt; 1524&lt;/SPAN&gt;&lt;SPAN class=""&gt;         return self._handle_response(&lt;/SPAN&gt;&lt;SPAN class=""&gt;   1525&lt;/SPAN&gt;             resp&lt;SPAN class=""&gt;=&lt;/SPAN&gt;resp&lt;SPAN class=""&gt;,&lt;/SPAN&gt;
&lt;SPAN class=""&gt;   1526&lt;/SPAN&gt;             out_path&lt;SPAN class=""&gt;=&lt;/SPAN&gt;out_path&lt;SPAN class=""&gt;,&lt;/SPAN&gt;

&lt;SPAN class=""&gt;/opt/conda/lib/python3.9/site-packages/arcgis/gis/_impl/_con/_connection.py&lt;/SPAN&gt; in &lt;SPAN class=""&gt;_handle_response&lt;/SPAN&gt;&lt;SPAN class=""&gt;(self, resp, file_name, out_path, try_json, force_bytes, ignore_error_key)&lt;/SPAN&gt;
&lt;SPAN class=""&gt;    998&lt;/SPAN&gt;                     &lt;SPAN class=""&gt;return&lt;/SPAN&gt; data
&lt;SPAN class=""&gt;    999&lt;/SPAN&gt;                 errorcode &lt;SPAN class=""&gt;=&lt;/SPAN&gt; data&lt;SPAN class=""&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;"error"&lt;/SPAN&gt;&lt;SPAN class=""&gt;]&lt;/SPAN&gt;&lt;SPAN class=""&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;"code"&lt;/SPAN&gt;&lt;SPAN class=""&gt;]&lt;/SPAN&gt; &lt;SPAN class=""&gt;if&lt;/SPAN&gt; &lt;SPAN class=""&gt;"code"&lt;/SPAN&gt; &lt;SPAN class=""&gt;in&lt;/SPAN&gt; data&lt;SPAN class=""&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;"error"&lt;/SPAN&gt;&lt;SPAN class=""&gt;]&lt;/SPAN&gt; &lt;SPAN class=""&gt;else&lt;/SPAN&gt; &lt;SPAN class=""&gt;0&lt;/SPAN&gt;
&lt;SPAN class=""&gt;-&amp;gt; 1000&lt;/SPAN&gt;                 self&lt;SPAN class=""&gt;.&lt;/SPAN&gt;_handle_json_error&lt;SPAN class=""&gt;(&lt;/SPAN&gt;data&lt;SPAN class=""&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;"error"&lt;/SPAN&gt;&lt;SPAN class=""&gt;]&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt; errorcode&lt;SPAN class=""&gt;)&lt;/SPAN&gt;
&lt;SPAN class=""&gt;   1001&lt;/SPAN&gt;             &lt;SPAN class=""&gt;return&lt;/SPAN&gt; data
&lt;SPAN class=""&gt;   1002&lt;/SPAN&gt;         &lt;SPAN class=""&gt;else&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;

&lt;SPAN class=""&gt;/opt/conda/lib/python3.9/site-packages/arcgis/gis/_impl/_con/_connection.py&lt;/SPAN&gt; in &lt;SPAN class=""&gt;_handle_json_error&lt;/SPAN&gt;&lt;SPAN class=""&gt;(self, error, errorcode)&lt;/SPAN&gt;
&lt;SPAN class=""&gt;   1021&lt;/SPAN&gt; 
&lt;SPAN class=""&gt;   1022&lt;/SPAN&gt;         errormessage &lt;SPAN class=""&gt;=&lt;/SPAN&gt; errormessage &lt;SPAN class=""&gt;+&lt;/SPAN&gt; &lt;SPAN class=""&gt;"\n(Error Code: "&lt;/SPAN&gt; &lt;SPAN class=""&gt;+&lt;/SPAN&gt; str&lt;SPAN class=""&gt;(&lt;/SPAN&gt;errorcode&lt;SPAN class=""&gt;)&lt;/SPAN&gt; &lt;SPAN class=""&gt;+&lt;/SPAN&gt; &lt;SPAN class=""&gt;")"&lt;/SPAN&gt;
&lt;SPAN class=""&gt;-&amp;gt; 1023&lt;/SPAN&gt;         &lt;SPAN class=""&gt;raise&lt;/SPAN&gt; Exception&lt;SPAN class=""&gt;(&lt;/SPAN&gt;errormessage&lt;SPAN class=""&gt;)&lt;/SPAN&gt;
&lt;SPAN class=""&gt;   1024&lt;/SPAN&gt; 
&lt;SPAN class=""&gt;   1025&lt;/SPAN&gt;     def post_multipart(

&lt;SPAN class=""&gt;Exception&lt;/SPAN&gt;: Unable to add feature service definition.
Invalid argument. Source service infos_UD_v2 does not exist.
(Error Code: 400)&lt;/PRE&gt;&lt;P&gt;what's strange is that the infos_UD_v2 table does exist&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2024 20:20:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-create-advanced-view-with-arcgis-api-for/m-p/1486567#M10128</guid>
      <dc:creator>MatthieuANDRE3</dc:creator>
      <dc:date>2024-06-06T20:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: how to create advanced view with arcgis api for python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-create-advanced-view-with-arcgis-api-for/m-p/1486631#M10130</link>
      <description>&lt;P&gt;it works, I had to adapt some things I hadn't thought of.&lt;BR /&gt;many thanks&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2024 21:16:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-create-advanced-view-with-arcgis-api-for/m-p/1486631#M10130</guid>
      <dc:creator>MatthieuANDRE3</dc:creator>
      <dc:date>2024-06-06T21:16:55Z</dc:date>
    </item>
  </channel>
</rss>

