Skip to main content
Solved

Single Workbench trying to either INSERT or UPDATE ArcGIS Online Table

  • November 26, 2022
  • 2 replies
  • 147 views

benvk
Contributor
Forum|alt.badge.img+8
  • Contributor
  • 60 replies

EDIT:

I have created a text parameter with value contractor_log and used that as the layer name in both, this seems to have fixed the problem (not fully tested yet). This seems to be more of  a hack than a proper solution. Is there a 'more correct' way I should be doing this?

 

Hey, 

I have a workbench that manipulates some input data, then it checks an arcgis online table (contractor_log) to see if this particular mobile number exists in the AGOL table. I need the AGOL table to be UPDATED if the mobile number exists in the table, but if it is new (non existent in the AGOL table) I need FME to INSERT a row into this AGOL table, which is a dozen field to insert.

 

I have inserted the AGOL WRITER into my workspace, setup my UPDATE writer which works perfectly, I now wish to duplicate this writer to setup my INSERT, but when I create a copy of this it must contain a unique layer (table) name, which is not ideal, as I want both writers connecting to the same AGOL Layer/table.

 

See this photo, it adds the 00 to the duplicated table, I cannot use it as it stands as I get the error 

ArcGIS Online Feature Service Writer: Could not find a layer/table matching feature type 'contractor_log00'

imageAny ideas how I can write either INSERT or UPDATE within the same workspace?

 

Best answer by egge

Hey,

You are talking about quite a common scenario here, with data changing and new data popping up all the time. And yes, you can handle this kind of situation with FME. Of course :-)

You should have a look at the ChangeDetector transformer which will add the fme_db_operation attribute to the features.

 

There is quite some documentation available on this topic in the FME Community. So, with the help of these articles and tutorials you should be able to get it up and running in your case:

And in FME 2022.1, the ability to perform UPSERT operations when writing out to ArcGIS Online Feature Services has been introduced: Updating ArcGIS Online Feature Services using UPSERT

Please let us know whether you manged to solve the issue.

 

Cheers,

 

Egge-Jan

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

egge
Contributor
Forum|alt.badge.img+14
  • Contributor
  • 102 replies
  • Best Answer
  • November 27, 2022

Hey,

You are talking about quite a common scenario here, with data changing and new data popping up all the time. And yes, you can handle this kind of situation with FME. Of course :-)

You should have a look at the ChangeDetector transformer which will add the fme_db_operation attribute to the features.

 

There is quite some documentation available on this topic in the FME Community. So, with the help of these articles and tutorials you should be able to get it up and running in your case:

And in FME 2022.1, the ability to perform UPSERT operations when writing out to ArcGIS Online Feature Services has been introduced: Updating ArcGIS Online Feature Services using UPSERT

Please let us know whether you manged to solve the issue.

 

Cheers,

 

Egge-Jan


benvk
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • 60 replies
  • November 29, 2022

Hey,

You are talking about quite a common scenario here, with data changing and new data popping up all the time. And yes, you can handle this kind of situation with FME. Of course :-)

You should have a look at the ChangeDetector transformer which will add the fme_db_operation attribute to the features.

 

There is quite some documentation available on this topic in the FME Community. So, with the help of these articles and tutorials you should be able to get it up and running in your case:

And in FME 2022.1, the ability to perform UPSERT operations when writing out to ArcGIS Online Feature Services has been introduced: Updating ArcGIS Online Feature Services using UPSERT

Please let us know whether you manged to solve the issue.

 

Cheers,

 

Egge-Jan

Amazing answer, the change detector sounds like it will do exactly what I want! I will see how I go with that. Thanks again for all the links!