Find the mistake in the Query Layer activity (Where)
I get stuck extending the following query? What am I doing wrong? Notification: 0: "Unable to perform query operation." & 1: "Invalid query"
query:
=`<NameID>='$ {$<resultname>.result.attributes["GlobalID"] }'` +
`<NameID>='$ {$<resultname>.result.attributes["Field2"] !== NULL }'`
(Thanks in advance!)
-
What I am trying to achieve: Get all values related to chosen object WHOSE value from field Y must not be NULL.
0 -
Hi M Z, Usually I'll try to work backwards a bit when setting up a where clause. I'd start with testing a where clause on the REST endpoint until I find a format that works, and then go from there and try to build the expression in the workflow that will output that format.
For example, here's a public service that has some globalid-type fields and some null values:
https://sampleserver6.arcgisonline.com/arcgis/rest/services/WindTurbines/MapServer/0
I used the Query operation on the REST endpoint there and found that this is the format you need to query a globalid field and to do a "not null" check.
globalid = '{DF9403DA-C08D-4C5C-A505-77A761F296D9}' and status IS NOT NULLFrom there, I'd build an expression to make a where clause that looks like that. Looking at your original expression, I think you'd want something like this:
=`FieldName = '${$ResultName.result.attributes["GlobalID"]}' and FieldName IS NOT NULL`(where FieldName is replaced with field name(s) from the layer we're querying and $ResultName.result is a feature object from earlier up in the workflow)
But if I'm mistaken and you actually wanted to check for nulls on Field2 from a previous query's results rather than checking for nulls on Field2 in the current query , let me know.
0 -
Good morning Amanda,
Thank you very much for the detailed explanation. This is much appreciated on this side! I will immediately start working on this with renewed positive energy: P
I find the last question difficult to answer because I may interpret the question a little differently. Therefore a short explination (hope this will help): Because based on a previously chosen geometry we now want to retrieve all the related (table) values. However, in addition to the related value, we also apply a national or local value. This difference is made whether or not Field2 is filled in. So I would say based on a previous query result?
Thanks in advance so far! Kind regards,
Manda.
0
Please sign in to leave a comment.
Comments
3 comments