<?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: Python GP tool to edit Postgres table  in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/python-gp-tool-to-edit-postgres-table/m-p/291220#M14501</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Web AppBuilder Edit Widget does have the ability to add related records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c;"&gt;"To add related records (when available), scroll down the pop-up and click the pencil icon to the right of the related table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Related tables" src="http://doc.arcgis.com/en/web-appbuilder/create-apps/GUID-ED8EB055-40C3-4C77-8629-D9BDCE7BB7EC-web.png" style="border: none;" title="Related tables" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c;"&gt;A pop-up shows the records related to the attribute, if any. Click the &lt;/SPAN&gt;&lt;SPAN class="" style="color: #4c4c4c; font-weight: bold;"&gt;+&lt;/SPAN&gt;&lt;SPAN style="color: #4c4c4c;"&gt; icon to open its pop-up and add the information."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c;"&gt;&lt;A class="link-titled" href="http://doc.arcgis.com/en/web-appbuilder/create-apps/widget-edit.htm" title="http://doc.arcgis.com/en/web-appbuilder/create-apps/widget-edit.htm"&gt;Edit widget—Web AppBuilder for ArcGIS | ArcGIS&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Mar 2017 19:41:44 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2017-03-13T19:41:44Z</dc:date>
    <item>
      <title>Python GP tool to edit Postgres table</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/python-gp-tool-to-edit-postgres-table/m-p/291219#M14500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Problem: can't add new.rexord to related table in AGOL, so appreciate any feedback on if a Python script could work / if the workflow makes sense in general.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to create a spatially enabled document database, with a few more capabilities than the basic attachment manager. Collector is a possibility, but this is a school project, and I'm trying to get this to work as an enterprise gdb.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first goal is to have a web app in which a user can add a document and enter attributes (author, type of document and the site it is related to). &amp;nbsp;A document can relate to one or many sites. I know it is not best DB design, but if a document relates to several sites, it is entered as a separate record each time for each site.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second goal is to be able to SQL and spatial query- e.g. "which sites have documents of category x", "which sites have documents expiring in 30 days", "which documents are related to this group of sites"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The basic workflow in desktop is to start edit session, add a new record to tbl_doxuments, use attachment manager to upload a document to that record. When publishing as feature service, no built in widgets have the ability to add a new record to the related table (documents)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data&lt;/P&gt;&lt;P&gt;1) FC_sites: point FC with names of sites. 1:m rc with tbl_doxuments&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) Tbl_documents: postgres table with each documents attributes, and attachments have been enabled. The site name is also entered and that is the key to FC_sites&lt;/P&gt;&lt;P&gt;3) Tbl_documents_ATTACH: actual storage of each doc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proposed Python script&lt;/P&gt;&lt;P&gt;1) create a new record in tbl_documents - user enters document attributes. Retrieve the new object id&lt;/P&gt;&lt;P&gt;2) create a temporary match table for the one document to the one new record. (New OBJ ID+ filename)&lt;/P&gt;&lt;P&gt;3) call add attachments to add the file to the docunents table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would then publish this as a GP tool and set the parameters for the user to enter the various attributes/file path and upload the doc. I will probably then work with enhanced query widget to set up the different queries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes&lt;/P&gt;&lt;P&gt;-Will using the Python gp tool actually be able create the new record in the Postgres DB?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- I do have a "BYTEA" field already in the tbl_documents, so possible to add a document directly to that table, but to use arcpy tools, think I have to have the separate documents_ATTACH table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I truly appreciate any feedback, and I will try to post code as I get it to work. Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Mar 2017 17:38:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/python-gp-tool-to-edit-postgres-table/m-p/291219#M14500</guid>
      <dc:creator>EdwardParry1</dc:creator>
      <dc:date>2017-03-11T17:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: Python GP tool to edit Postgres table</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/python-gp-tool-to-edit-postgres-table/m-p/291220#M14501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Web AppBuilder Edit Widget does have the ability to add related records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c;"&gt;"To add related records (when available), scroll down the pop-up and click the pencil icon to the right of the related table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Related tables" src="http://doc.arcgis.com/en/web-appbuilder/create-apps/GUID-ED8EB055-40C3-4C77-8629-D9BDCE7BB7EC-web.png" style="border: none;" title="Related tables" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c;"&gt;A pop-up shows the records related to the attribute, if any. Click the &lt;/SPAN&gt;&lt;SPAN class="" style="color: #4c4c4c; font-weight: bold;"&gt;+&lt;/SPAN&gt;&lt;SPAN style="color: #4c4c4c;"&gt; icon to open its pop-up and add the information."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c;"&gt;&lt;A class="link-titled" href="http://doc.arcgis.com/en/web-appbuilder/create-apps/widget-edit.htm" title="http://doc.arcgis.com/en/web-appbuilder/create-apps/widget-edit.htm"&gt;Edit widget—Web AppBuilder for ArcGIS | ArcGIS&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Mar 2017 19:41:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/python-gp-tool-to-edit-postgres-table/m-p/291220#M14501</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2017-03-13T19:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: Python GP tool to edit Postgres table</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/python-gp-tool-to-edit-postgres-table/m-p/291221#M14502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Katie-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you happen to have a live site with that functionality?&amp;nbsp; I have seen that in the Help, but it is not functioning on my web app.&amp;nbsp; I can click the +, but there is no action, also, it does not seem to allow it on a site that does not currently ave any related records. .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Possible factors issues that I am working through:&lt;/P&gt;&lt;P&gt;1) Would it be a factor that it is a Postgres table with a relationship class as opposed to a relate?&lt;/P&gt;&lt;P&gt;2) the table is non-versioned, but the FC is versioned.&amp;nbsp; Tried to set the table as versioned, but showed my one of my postgres schemas having a lock&lt;/P&gt;&lt;P&gt;3) maybe there is a lock from desktop or pgAdmin that is not allowing it to&amp;nbsp;commit&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I set up a python GP tool (using insert cursor), again, works fine on Desktop and publishes, but shows a "Submitting...Executing...Failure" message in weppApp builder&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Link to the app.&amp;nbsp; GP # 1 allows user to specify table (in desktop tool GUI), the GP #2 is hardcoded to the table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://ncsu.maps.arcgis.com/apps/webappbuilder/index.html?id=cd5ec81eb9f34a0c9a982fbc8422b872"&gt;http://ncsu.maps.arcgis.com/apps/webappbuilder/index.html?id=cd5ec81eb9f34a0c9a982fbc8422b872&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Mar 2017 20:16:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/python-gp-tool-to-edit-postgres-table/m-p/291221#M14502</guid>
      <dc:creator>EdwardParry1</dc:creator>
      <dc:date>2017-03-13T20:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: Python GP tool to edit Postgres table</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/python-gp-tool-to-edit-postgres-table/m-p/291222#M14503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Katie, I have seen the edit widget and have tried to use it for a similar goal but it does not seem possible to upload attachments (.docx, .pdf, .xlsx...) into the related table due to the underlying&amp;nbsp;process. The processes that I am referring to is that when generating a BLOB field that houses attachments a related table is created to host the document contents and metadata. Therefore when relating the first table to the feature class there is also a secondary related table attached. This processes is supported by the desktop version and when using the pre-designed theme crowdsource polling but crowdsource polling does not allow for much customization.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Mar 2017 01:14:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/python-gp-tool-to-edit-postgres-table/m-p/291222#M14503</guid>
      <dc:creator>KyleBlessman</dc:creator>
      <dc:date>2017-03-14T01:14:29Z</dc:date>
    </item>
  </channel>
</rss>

