<?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: Create view layer in arcgis python api and make certain fields visiblity to be off and editable properties should be false in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/create-view-layer-in-arcgis-python-api-and-make/m-p/1313336#M8905</link>
    <description>&lt;P&gt;By setting the the specific fields visibile and editable properties to be False and then update_defination for the feature collection we can achieve it.&lt;/P&gt;</description>
    <pubDate>Sat, 29 Jul 2023 07:04:59 GMT</pubDate>
    <dc:creator>NiharSahoo</dc:creator>
    <dc:date>2023-07-29T07:04:59Z</dc:date>
    <item>
      <title>Create view layer in arcgis python api and make certain fields visiblity to be off and editable properties should be false</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/create-view-layer-in-arcgis-python-api-and-make/m-p/1310432#M8884</link>
      <description>&lt;P&gt;I have created a view_layer using below code but i have not get any reference to update the visibility and editability properties for each feature layers. I have use the below code, please refer any process of how i could be able to update the properties.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcgis
from arcgis.features import FeatureLayer
from arcgis.features import FeatureLayerCollection

user_name = "UserName"
pass_word = "PassWord"
gis = arcgis.gis.GIS("https://www.arcgis.com", user_name, pass_word)
layer_name = "My_layer"
view_name = "My_view1"
layer_index = 0
view_def = {"viewDefinitionQuery": "Fields in ['ch_name']"}

search_results = gis.content.search(layer_name, item_type="Feature Layer")
proper_index = [index for index, s in enumerate(search_results)
if '"' + layer_name + '"' in str(s)]
found_item = search_results[proper_index[0]]
flc = FeatureLayerCollection.fromitem(found_item)
new_view = flc.manager.create_view(name=view_name)
view_flc = flc
view_layer = view_flc.layers[layer_index]
flc.manager.update_definition(view_def)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code show error for the following line:&lt;BR /&gt;"view_def = {"viewDefinitionQuery": "Fields in ['ch_name']"}"&lt;BR /&gt;Please assist me to write the veiw defination correctly to disply only selected fields.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jul 2023 06:41:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/create-view-layer-in-arcgis-python-api-and-make/m-p/1310432#M8884</guid>
      <dc:creator>SriyankarDandapat</dc:creator>
      <dc:date>2023-07-29T06:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: Create view layer in arcgis python api and make certain fields visiblity to be off and editable properties should be false</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/create-view-layer-in-arcgis-python-api-and-make/m-p/1313336#M8905</link>
      <description>&lt;P&gt;By setting the the specific fields visibile and editable properties to be False and then update_defination for the feature collection we can achieve it.&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jul 2023 07:04:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/create-view-layer-in-arcgis-python-api-and-make/m-p/1313336#M8905</guid>
      <dc:creator>NiharSahoo</dc:creator>
      <dc:date>2023-07-29T07:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: Create view layer in arcgis python api and make certain fields visiblity to be off and editable properties should be false</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/create-view-layer-in-arcgis-python-api-and-make/m-p/1340705#M9181</link>
      <description>&lt;P&gt;Did you ever find an answer for this? I was searching for the same thing and came across your post....it just doesn't have much in it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 21:33:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/create-view-layer-in-arcgis-python-api-and-make/m-p/1340705#M9181</guid>
      <dc:creator>SFM_TravisBott</dc:creator>
      <dc:date>2023-10-23T21:33:41Z</dc:date>
    </item>
  </channel>
</rss>

