Can "update a feature - feature service" output connector updating some fields and leave others unchanged?

3186
3
07-12-2016 04:57 PM
LifangHuang
New Contributor

Hi I wonder if I can use the "Update a Feature" connector to update some, not all, of the fields in my feature layer. I noticed my existing data is getting wiped out if I did not have any field mapped to the feature layer event definition. Any way I can keep the rest of fields intact?

0 Kudos
3 Replies
ChrisBeyett
Occasional Contributor

Lifang, 

Apologies for getting to you so late, but I hope to clarify how the "Update a Feature" output connector works. This connector utilizes the ArcGIS Server REST endpoint to update any or all fields of a Feature Service based on the OBJECTID in the GeoEvent Definition. Let's look at the following example of oil well data:

GeoEvent Definition:

1. OBJECTID

2. Well_ID (TRACK_ID Tag)

3. Well Name

4. Operator

5. TD

6. Lat

7. Long

8. Geometry (GEOMETRY Tag)

The GeoEvent Definition above was imported from a Feature Service that was published to ArcGIS Server.This Feature Service is a master data set of all oil wells drilled within the particular area. We want to update only the TD (Total Depth) field, as an existing oil well was recently drilled to a new depth. If we used the above definition to send the new depth value, the Update a Feature output connector would still send all fields to the ArcGIS Server. There are two ways you can avoid re-writing all fields of the data without throwing errors: 

1. Use a Field Reducer Processor inside of the GeoEvent Service. 

By incorporating the Field Reducer Processor into the GeoEvent Service, it will strip the unwanted fields off the output to the ArcGIS Server. You could eliminate all fields except for: OBJECTID, Well_ID and TD and still produce a valid result. This would also make for an easier setup, as you do not have to manage a new GeoEvent Definition.

2. Create a new GeoEvent Definition containing only the fields you'd like to be updated. Then use a Field Mapper Processor.to map the old definition to the new. This produces the same effect as above but requires you to create and manage the new definition. 

Once either of these two methods are used, the fields are restricted to only what you need, and GeoEvent will pass this along to the ArcGIS Server where the final updates will take place. The updates are taking place using the ArcGIS Server REST endpoint, specifically the updateFeatures operation. For more information on this operation, you can reference the following help document

Update Features (Operation)  

If you would like a more in-depth look at the Update a Feature output connector or further clarification please let me know, as I can use this example to create a GeoEvent Service for screenshots and detailed reference. 

-Chris

JackZHANG
Occasional Contributor II

Hi @Chris Beyett, ypzzcy

Is the "Update a Feature" only updated features based on OBJECTID?  In my "Update a Feature" output, I used trackerid which is a ID from the GPS device, rather than OBJECTID. And I ticked "No" for "Update only" which I assume it allows to add a new feature to the feature layer if the incoming trackerID not existed. BTW, the feature layer service is hosted on our Portal and have all edit and add permissions as setted below. 

The output Geoevent definition as below:

  • trackerid (Track_ID)
  • datetime 
  • geometry (Geometry)

 

The problem I'm having at the moment are:

1. It didn't add new features when the incoming event has a new trackerID

2. then I added the feature manually to the feature layer with a new unique trackerID, when a new input event received with the trackerID, it didn't update the feature I manually added with the matching trackerID. 

0 Kudos
TL2
by
Occasional Contributor III

Can you use another field as the Where field instead of ObjectID when updating a feature?

0 Kudos