ArcGIS Pro Scheduled Model Builder Query ArcGIS Online Hosted Feature Service

122
1
Jump to solution
03-03-2021 01:36 PM
Labels (1)
MichaelBruening
New Contributor III

Hello,

I have built a ModelBuilder that will query and delete features from a Hosted ArcGIS Online Feature Service that I am owner of and I am also an Administrator for the ArcGIS Organization.

I am using

  • the "Select by Attributes" tool that I have created an "Input Layer" and "Expression" parameters for.
  • Within the "expression" I am passing 2 "inline variables" that are obtained from the "Get Field Values" Utility tool for ModelBuilder.
  • I am  also utilizing the direct Feature Service URL within a "parameter" for the "Select By Attribute" tool input features.
  • Once the query has ran, then I am using the Delete Features tool to "delete" the features from the ArcGIS Online Hosted Feature Service.
  • This is then this is followed by the Append tool to push the new features into the same ArcGIS Online Hosted Feature Service to replace the deleted features.

I want to do this with only selected features and not the entire Hosted Feature Service, so replacing/overwriting the Hosted Feature Service is not an option.

When I run the ModelBuilder while ArcGIS Pro is open, then the model will run successfully; the old features are selected from the query, deleted, and appended with the new features.

However, when I use ArcGIS Pro to "schedule" the model to run on a certain time interval, then I receive an error that states the following lines within the Geoprocessing History of the scheduled event -

1). Executing (Select Existing Cells Layer By Attribute): SelectLayerByAttribute EDGE_Survey_Cells "New selection" "Stream_Name = 'GMR' And ProjectNumber = 'TST2021-0004-001'" #
2). Start Time: Wednesday, March 3, 2021 3:53:10 PM
3). ERROR 000358: Invalid expression
4). Failed to execute (Select Existing Cells Layer By Attribute).

So I am wondering if I will need to devise some sort of Python for ArcGIS scripting or if this is actually achievable within the use of Model Builder and the Select by Attributes tool or a combination of both.

Any information or direction within the right direction would be greatly appreciated.

0 Kudos
1 Solution

Accepted Solutions
MichaelBruening
New Contributor III

Solved this myself by using the "Make Table View" while pointing the output workspace to my FGDB and everything went smoothly. Selected the correct features within the Hosted Feature Service, completed the delete on just those features, and then completed the append.

View solution in original post

0 Kudos
1 Reply
MichaelBruening
New Contributor III

Solved this myself by using the "Make Table View" while pointing the output workspace to my FGDB and everything went smoothly. Selected the correct features within the Hosted Feature Service, completed the delete on just those features, and then completed the append.

View solution in original post

0 Kudos