<?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 Programmatically creating a view when service layer ids not in order. in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/programmatically-creating-a-view-when-service/m-p/1487480#M59637</link>
    <description>&lt;P&gt;I have a notebook that creates views from user-entered services. Pretty straightforward.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RandyMcGregor_BMcD_0-1717795514061.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/106520iCC54E9E1DE21BDBC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RandyMcGregor_BMcD_0-1717795514061.png" alt="RandyMcGregor_BMcD_0-1717795514061.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;There is an issue with services whose layer ids are not sequentially ordered top-down. The created view is an unusable mess. The layers are out of order, polygon layers become line layers, etc...&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, this service has three layers&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RandyMcGregor_BMcD_1-1717795633887.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/106521i457EEFC3D86CC461/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RandyMcGregor_BMcD_1-1717795633887.png" alt="RandyMcGregor_BMcD_1-1717795633887.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In the rest end point details page, their layer ids are seen to be not top-down-sequential&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RandyMcGregor_BMcD_2-1717795685856.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/106523i54B7455118EAD4F7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RandyMcGregor_BMcD_2-1717795685856.png" alt="RandyMcGregor_BMcD_2-1717795685856.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The resulting view has the layers in a different order, which would not be terrible, except...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RandyMcGregor_BMcD_4-1717795903417.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/106525i2D993B3B5DEDD54C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RandyMcGregor_BMcD_4-1717795903417.png" alt="RandyMcGregor_BMcD_4-1717795903417.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When opened in the map viewer, everything falls apart. This is the&amp;nbsp;&lt;EM&gt;third&lt;/EM&gt; ordering scheme, and floodplain is a line layer, and the flowline layer is a polygon. Creating the view manually does not have this effect. It works fine, but is laborious. There are many filters that need to be applied.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RandyMcGregor_BMcD_3-1717795863338.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/106524i85320245F3F3791E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RandyMcGregor_BMcD_3-1717795863338.png" alt="RandyMcGregor_BMcD_3-1717795863338.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If the service layer ids are sequential, top-down, this does not happen and the created view is fine.&lt;/P&gt;&lt;P&gt;Does any one know what might be causing this? Thank you for any information you may be able to provide.&lt;/P&gt;&lt;P&gt;Randy McGregor&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jun 2024 21:41:15 GMT</pubDate>
    <dc:creator>RandyMcGregor_BMcD</dc:creator>
    <dc:date>2024-06-07T21:41:15Z</dc:date>
    <item>
      <title>Programmatically creating a view when service layer ids not in order.</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/programmatically-creating-a-view-when-service/m-p/1487480#M59637</link>
      <description>&lt;P&gt;I have a notebook that creates views from user-entered services. Pretty straightforward.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RandyMcGregor_BMcD_0-1717795514061.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/106520iCC54E9E1DE21BDBC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RandyMcGregor_BMcD_0-1717795514061.png" alt="RandyMcGregor_BMcD_0-1717795514061.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;There is an issue with services whose layer ids are not sequentially ordered top-down. The created view is an unusable mess. The layers are out of order, polygon layers become line layers, etc...&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, this service has three layers&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RandyMcGregor_BMcD_1-1717795633887.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/106521i457EEFC3D86CC461/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RandyMcGregor_BMcD_1-1717795633887.png" alt="RandyMcGregor_BMcD_1-1717795633887.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In the rest end point details page, their layer ids are seen to be not top-down-sequential&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RandyMcGregor_BMcD_2-1717795685856.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/106523i54B7455118EAD4F7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RandyMcGregor_BMcD_2-1717795685856.png" alt="RandyMcGregor_BMcD_2-1717795685856.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The resulting view has the layers in a different order, which would not be terrible, except...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RandyMcGregor_BMcD_4-1717795903417.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/106525i2D993B3B5DEDD54C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RandyMcGregor_BMcD_4-1717795903417.png" alt="RandyMcGregor_BMcD_4-1717795903417.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When opened in the map viewer, everything falls apart. This is the&amp;nbsp;&lt;EM&gt;third&lt;/EM&gt; ordering scheme, and floodplain is a line layer, and the flowline layer is a polygon. Creating the view manually does not have this effect. It works fine, but is laborious. There are many filters that need to be applied.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RandyMcGregor_BMcD_3-1717795863338.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/106524i85320245F3F3791E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RandyMcGregor_BMcD_3-1717795863338.png" alt="RandyMcGregor_BMcD_3-1717795863338.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If the service layer ids are sequential, top-down, this does not happen and the created view is fine.&lt;/P&gt;&lt;P&gt;Does any one know what might be causing this? Thank you for any information you may be able to provide.&lt;/P&gt;&lt;P&gt;Randy McGregor&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2024 21:41:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/programmatically-creating-a-view-when-service/m-p/1487480#M59637</guid>
      <dc:creator>RandyMcGregor_BMcD</dc:creator>
      <dc:date>2024-06-07T21:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically creating a view when service layer ids not in order.</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/programmatically-creating-a-view-when-service/m-p/1487484#M59638</link>
      <description>&lt;P&gt;I have instructed my staff to avoid allowing for the assignment of unique ids in the map from which a service is published. This is fine, since we normally do not need to overwrite services and do not need fixed layer ids that can be directly edited. However, this setting is inadvertently turned on sometimes. It would be nice to not have to worry about programmatically created views being unusable. It's not always obvious right away, and we've had to scramble to start over when realizing too late that a view was compromised.&lt;/P&gt;&lt;P&gt;Thank you for your time,&lt;/P&gt;&lt;P&gt;Randy McGregor&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2024 21:44:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/programmatically-creating-a-view-when-service/m-p/1487484#M59638</guid>
      <dc:creator>RandyMcGregor_BMcD</dc:creator>
      <dc:date>2024-06-07T21:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically creating a view when service layer ids not in order.</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/programmatically-creating-a-view-when-service/m-p/1488208#M59660</link>
      <description>&lt;P&gt;Apparently, this is a bug. A bug with a Status of 'As-Designed' which seems strange.&amp;nbsp;&lt;A href="https://support.esri.com/en-us/bug/creating-a-hosted-feature-layer-view-using-arcgis-api-f-bug-000159162" target="_blank"&gt;https://support.esri.com/en-us/bug/creating-a-hosted-feature-layer-view-using-arcgis-api-f-bug-000159162&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2024 12:51:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/programmatically-creating-a-view-when-service/m-p/1488208#M59660</guid>
      <dc:creator>RandyMcGregor_BMcD</dc:creator>
      <dc:date>2024-06-10T12:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically creating a view when service layer ids not in order.</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/programmatically-creating-a-view-when-service/m-p/1488212#M59661</link>
      <description>&lt;P&gt;It appears that the attribute 'preserve_layer_id' is what you need when your ids are non-sequential, but I have not had luck with that:&lt;/P&gt;&lt;P&gt;This code:&lt;/P&gt;&lt;P&gt;new_view=flc.manager.create_view(name=serviceName+"_View5", preserve_layer_ids=True)&lt;/P&gt;&lt;P&gt;Gives the following error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RandyMcGregor_BMcD_0-1718024017724.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/106611i18E771A2ACBE435F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RandyMcGregor_BMcD_0-1718024017724.png" alt="RandyMcGregor_BMcD_0-1718024017724.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If I change &lt;STRONG&gt;True&lt;/STRONG&gt; to &lt;STRONG&gt;False&lt;/STRONG&gt;, I get no error, so I don't think the problem is that I'm entering it wrong. It just refuses to accept the value of &lt;STRONG&gt;True&lt;/STRONG&gt;. Does anyone know why? Creating the view manually preserves layer ids by default, but programmatically creating views that are useable even if the ids are out order would be very helpful. It's not always apparent that this has happened until too late.&lt;/P&gt;&lt;P&gt;Thank you for any help you may be able to provide.&lt;/P&gt;&lt;P&gt;Randy McGregor&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2024 12:56:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/programmatically-creating-a-view-when-service/m-p/1488212#M59661</guid>
      <dc:creator>RandyMcGregor_BMcD</dc:creator>
      <dc:date>2024-06-10T12:56:09Z</dc:date>
    </item>
  </channel>
</rss>

