Select to view content in your preferred language

Scheduled ModelBuilder task fails on Select Layer By Attribute using Hosted Feature Layers (Error 000358 Invalid Expression)

3529
15
02-10-2022 07:21 AM
DataOfficer
Frequent Contributor

I have a ModelBuilder process which carries out the following (diagram attached):

  1. Uses a hosted feature layer containing site boundary polygons (Layer1) as an input to a Select Layer By Attribute tool
  2. This uses a simple SQL expression to select rows in Layer1 meeting certain criteria
  3. The Select Layer By Location tool uses a second hosted feature layer containing polygons (Layer2) as input features, and selects them based on an Intersect relationship with the Layer1 features selected in step 2.
  4. The Calculate Field tool is used to overwrite text in a field of the selected rows in Layer2

When run 'in person' in ArcGIS Pro, the model runs without issue. However, it fails when run as a Scheduled Task, giving the following error:

ERROR 000358: Invalid expression
Failed to execute (Select Layer By Attribute).

The error help page is not particularly useful in this instance. Any ideas?

0 Kudos
15 Replies
DataOfficer
Frequent Contributor

Glad you got it working. My field is not numerical but it still fails unfortunately.

0 Kudos
Ramon_de_Leon
Frequent Contributor

I see, might be a separate issue then for hosted layers (I was working on local file geodatabase/SDE).

I did check though and I have a scheduled model tool (ArcGIS Pro 2.9.2) that has a bunch of "Select Layer by Attribute" (non-numeric field) and its been working, the thing though is I am working on a file geodatabase then overwriting my feature layer after am done with my geoprocessing.

You might want to try creating a local copy of your "feature layer" and use that as input for your model after you are done you can overwrite your feature layer or do a delete rows/append to just insert the records that have changes.

0 Kudos
CESPEDESLUISITD
Regular Contributor

Thank God I found this thread.

I also have been going crazy with this. Modified my model, my script, nothing worked when scheduling this to update a hosted feature layer. Manually it works perfectly.

I am not too frustrated as this has to run monthly, but man it can drive you nuts not knowing that is a bug.

Running on 2.9.3 right now.

I think 3.0 was released today. 

0 Kudos
Michael_VanHatten
Regular Contributor

I installed 3.0 today and go figure I am still having issues. Now a new error message shows up, have you had a chance to install and try out the scheduler with 3.0?

CESPEDESLUISITD
Regular Contributor

Hi Michael, not I have not.

I was about to when I asked my GIS IT group if it was OK and they told me not to as it may also have issues. To wait until a further release is available.

Go figure, a release to fix the release that was to fix a previous release.

I will wait to see when I can install it and then let you know.

Sorry to hear you still have issues.

0 Kudos
DataOfficer
Frequent Contributor

I've carried out some limited testing so far using 3.0 and it seems to have resolved the issue. I will report back if that changes though with further testing.

What's the new error message @Michael_VanHatten ?

0 Kudos