Overwrite ArcGIS Online Feature Service using Truncate and Append

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ม.ค. 2025

ความคิดเห็น • 21

  • @ChristianKennedy-e1o
    @ChristianKennedy-e1o 3 หลายเดือนก่อน

    Thank you so much for this! I am also running into the issue with the IndexError: List Index Out Of Range". I am using the index number I find when I go to the rest endpoint. Any recommendations? I see I am not the only one that has run into this! Thank you!

    • @gisinfo8638
      @gisinfo8638  3 หลายเดือนก่อน +1

      @ChristianKennedy-e1o, it's a little confusing, the index is actually the order in which the layer is. For example, if the layer is the 3rd layer in the service, the index would be 2, even though the REST endpoint is showing the layer with a value of 6.

    • @ChristianKennedy-e1o
      @ChristianKennedy-e1o 3 หลายเดือนก่อน

      @@gisinfo8638 Perfect. With that info, I got it figure out! Much appreciated.

    • @ChristianKennedy-e1o
      @ChristianKennedy-e1o 3 หลายเดือนก่อน

      @@gisinfo8638 Thank you! One other question, any chance this would this work for Enterprise Portal as well? Might be a dumb question but google isn't giving me much and I have a request to do this for portal as well.

    • @gisinfo8638
      @gisinfo8638  3 หลายเดือนก่อน +1

      @@ChristianKennedy-e1o yes, this will work for Portal as well.

  • @xmixaplix
    @xmixaplix ปีที่แล้ว

    Hi, I am also doing a Truncate/Append albeit a slightly different way but today I found that my method does not truncate related Tables for the Feature Service; only the Layers. I am wondering if your script handles the Tables too?

    • @gisinfo8638
      @gisinfo8638  ปีที่แล้ว +1

      Yes, it can handle tables as well, however you will need to execute the script twice. Once when it's configured for the feature service layer, and another time when it's configured for the feature service table.

    • @xmixaplix
      @xmixaplix ปีที่แล้ว

      @@gisinfo8638 Hi just another question. So my Feature Service that has both a Layer and a Table with a Parent/Child relationship established when it was published to AGOL. Do I have to do an additional process to re-establish said relationship and if so, how would this be accomplished?

    • @gisinfo8638
      @gisinfo8638  ปีที่แล้ว

      @@xmixaplix No, you won't have to re-establish the relationship.

  • @user-gg6di4cy8x
    @user-gg6di4cy8x ปีที่แล้ว

    Hi, thanks for your post and video. I must keep sync enabled on the layer features I would like to replace, and also include photo attachments - is this possible? I can get script running, but attachments do not come through. Attachments exist on the local fc and attachments are enabled on the hosted feature layer. Could attachments be appended through a temporary hosted table?

    • @gisinfo8638
      @gisinfo8638  ปีที่แล้ว +1

      @user-gg6di4cy8x unfortunately, attachments are not supported with this tool. Attachments rely on Global IDs, and there is not currently a way to preserve them when appending a feature class to a hosted feature service.

    • @gisinfo8638
      @gisinfo8638  ปีที่แล้ว +1

      @user-gg6di4cy8x check out a new script that will help with attachments and sync enabled:
      community.esri.com/t5/arcgis-online-documents/overwrite-arcgis-online-feature-service-using/ta-p/1371248

    • @user-gg6di4cy8x
      @user-gg6di4cy8x ปีที่แล้ว

      @@gisinfo8638 Thank you kindly! I will certainly check this script out.

  • @Haskett06
    @Haskett06 11 หลายเดือนก่อน

    Can this be modified to work with ArcGIS Enterprise Portal instead of AGOL?

    • @gisinfo8638
      @gisinfo8638  11 หลายเดือนก่อน

      @Haskett06, yes, you can change the variables to reference your Enterprise Portal instead of AGOL.

  • @a2zGodz
    @a2zGodz 2 ปีที่แล้ว

    Does this overwrite the entire hosted feature service or is there a way we can check for edits and simply append those changes to the hosted feature service from our databases?

    • @gisinfo8638
      @gisinfo8638  2 ปีที่แล้ว

      Hi Jordan,
      Yes, you can check for edits. For the append operation (line 121), change 'upsert' to 'True' and add 'upsert_matching_field='. Replace with a field that contains unique values. In ArcGIS Online, this field must have a unique index. You can create this by going to the item details > Data tab. Click on the Fields tab. Click the field that contains unique values and click the edit option next to Unique. Check the option 'Field contains unique values'.

  • @LeoSpaceman2012
    @LeoSpaceman2012 11 หลายเดือนก่อน

    Thanks for the video. I am using this to update my hosted feature classes on Enterprise 10.9.1. My Address points have an index of 4, but when I enter that in it get an error. "IndexError: List Index Out Of Range" on line 73. That is the index number I find when I check the rest endpoint. Any help would be appreciated. Thanks agian

    • @gisinfo8638
      @gisinfo8638  11 หลายเดือนก่อน

      @LeoSpaceman2012 can you share the service you are trying to update to an AGOL group and invite my account, jskinner_rats?

  • @SianDoherty
    @SianDoherty 5 หลายเดือนก่อน

    Great video. Thanks. Would this work with oauth 2.0 authentication. i.e using client_id and secret to authenticate to ArcGIS online because we use single sign on?

    • @gisinfo8638
      @gisinfo8638  5 หลายเดือนก่อน

      @SianDoherty It can, but it will be an interactive experience. When authenticating with ArcGIS Online using the client ID, you will be presented with a web browser that provides you a code you would have to copy/paste. See the following help document on how this would work: developers.arcgis.com/python/guide/working-with-different-authentication-schemes/#:~:text=code%20shown%20below%3A-,Interactive%20Login%20Experience,-This%20uses%20interactive