Select to view content in your preferred language

Cannot access data error - Operations Dashboard

14371
15
04-30-2018 11:33 AM
LSaunders
Regular Contributor

I have been trying out the new Operations Dashboard, but have to use services that are fed from our Oracle database through query layers, the published as map services to our AGS (10.6).

In the old Operations Dashboard, I could load the layers from the service into a map and then use those to feed widgets.  In the new application (web based) I get an error on all of these layers "Cannot Access Data".  

Has anyone successfully done this with data that is being published from a query layer? 

15 Replies
ShelbyZelonisRoberson
Frequent Contributor

Hi Patrick -- I'm having a related problem and I was hoping you could provide insight. I am able to get query layers to work in my dashboard items (the query layers are coming from SQL server, similar to what your setup seems to be). However, I don't have any options to create Actions in any of the items (charts, lists, etc) with the layers that are built on query layers. There are no Actions tabs to configure when I choose these data sources. Patrick, are you able to use Actions with your query layer feature services or is this not possible in Ops Dashboard? 

0 Kudos
DarrenHaag
Occasional Contributor

So I was running into similar problems and will give a rundown of my findings.

In my case, we have capitol improvement points and lines on a map.  I am creating a dashboard to filter by year, type, status, etc using the widgets instead of selectors.  I needed a table with all the records to supply data to the widgets/metrics from both points and lines.  The fields in the points and lines match, so I created a sql view to union the points and lines into a table, then created a new objectid from the globalid’s. Then registered the view with the geodatabase.

Quasi code below

select c.*, cast(ROW_NUMBER() OVER(ORDER by c.globalid) as int) As objectid

from

(points union lines) c

this gave me the table I needed for the metrics.  When using it in the dashboard I could create metrics, but as another poster mentioned, I could not use widgets using data from the table to control layers on the map even though the fields matched 1 to 1.  Conversely, I could use layer selections on the map to filter the widgets created by the standalone table.  So it works in one direction, but not both.

With that attempt thwarted, I decided to go the sql spatial route.  I got the x,y from the points, then created an x,y from the lines based on the nearest point on a line to the centroid of the feature extent.(dealing with multiple line segments per feature).  With the x,y’s, I updated the view to a spatial view of points. Same code as above, adding in the logic to pull x,y’s from both tables, then geometry::point(x,y,srid) as shape after the row_number function.  In this attempt I could see the points, see the attribute table, etc..., in the map.  But when trying to create a metric with the service, I got the cannot acces data icon.  Same sharing as before.

third attempt, create the table view as before only adding in the x,y’s as fields.  Then create a query layer in pro and generate the points in the query layer instead of the view.  I used the globalid as my uniqueid in the query layer spatial properties window which then generates your esri_oid.  Same issue as above when trying to create metrics only this time it said cannot access data of 1038 records(number of records in my query layer).  Or something similar.  Still didn’t work, but an error at least giving me the count of records in the layer. (I’ll note that even though it says it can’t access the data, if you select a drop down to select fields for statistics, etc, all the fields from the layers populate). Progress.

final attempt. for some reason, I was stuck on objectid being the issue.  I was using globalid in the spatial properties window of the query layer dialog as my unique Id because it defaults to that.  But I had also created a new objectid in the union view, so it was also unique.  I used objectid as my unique Id in the spatial properties window and created the query layer.  This time, the query layer created, but did not create an esri_oid field and instead made my objectid field the unique Id field with the field type objectid instead of integer.  Plugged this layer into the dashboard and everything worked flawlessly.  Success.

now, I didn’t go any further down the rabbit hole to test why it wasn’t working before.  Did it need a field called objectid to be the unique identifier?  Did the fact I had objectid as an integer field in my query layer throw everything off because it wasn’t the designated unique field?  I’m guessing one or both of those 2 is the problem but I didn’t test.

Notes::

as stated above.  Creating widgets from standalone tables and then trying to filter map layers by those tables didn’t give an action option for the map layers.

now, I still have my cip polylines.  I’ve created a centroid point for them, but still want to show the associated lines when I select a point on the map.(using globalid as my connection between the 2 layers).  I can filter just the lines I want when I select a point.  But, when I don’t have a point selected, all the lines show up and I can’t control them with the widgets either since they were created using the points query layer.  The question I have is.  Is there a way to default a layer to filter out all the features and only show a feature after an action.  In my case, I select a point on the map and the lines associated with that point show up.  If no points are selected, all the lines are “hidden”.  If not, is this functionality on the radar for dashboards?

sorry for the extremely long winded response.  I was hoping to give users a workaround or ideas as to why the query layers may not be working as well as provide enough information for debugging purposes.  

BrianFausel
Frequent Contributor

Darren's response was the answer to my dilemma. After seeing the error "Cannot Access Data" with my spatial view, I was finally able to get the new "web-based" Op Dashboard to work by using OBJECTIDs. This works even with our legacy ArcGIS Server 10.3.1 / SQL 2008 R2 environment. I'll try to sum it up as best I can:

The key seems to be to use the OBJECTID attribute rather than the GLOBALID when you define the unique identifier in ArcMap. I have a pretty simple 1:M relationship modeling Hydrants(1):Events(M). The relationship class keys are Hydrant(GLOBALID):Event(GUID). Both the feature class and event table are in the same SDE geodatabase.

When adding the spatial view to ArcMap to create an ArcGIS Server map service, I was originally using the Event GLOBALID as the unique identifier. While the Event GLOBALID is unique, any time you add the service to the Op Dashboard it would give the message "Cannot Access Data." From there you couldn't create pie or serial charts.

SOLUTION: I re-created the map service using the Event OBJECTID as the identifier and now it works great with the Op Dashboard as well as the Web AppBuilder Infographic widgets.

Sidenote: The thing that was driving me most crazy was that I had other more complicated spatial views that were working the whole time while this new one was not. The other spatial views involved an SDE feature class and multiple business tables from an external asset management database. In that case, I was using the OIDs of the external database. So I can vouch that it also works outside SDE, provided you have that unique identifier.

DrewDowling
Frequent Contributor

This helped me immensely, thank you. I had created both spatial and non spatial views without an explicit attribute called objectid. I then added these views to ArcMap using the Add query layer option.  I had defined a composite unique index in arcmap when I added these views to ArcMap. The result was my dashboard was giving the no data error. 

After reading Brian Fausel  and Darren Haag posts I altered the underlying views to include a unique int field called objectid. I then registered these views with the geodatabase  and added them to the .mxd as any other table or feature class. After these steps these views started working in dashboard without a problem. Grouping, charting etc is working fine so far.

Steps:

  1. Create your view using SQL which includes a unique int field called objectid
  2. register the view with the geodatabase
  3. Add the view to ArcMap and publish feature service
  4. add service to web map
  5. Use the webmap to dashboard.
by Anonymous User
Not applicable

In support of what's been discussed above - if you look to the definition of the "Source" - is ESRI using this to determine that an objectid exists?

Data Type: XY Event Source
Server: xxxx
User: xxxxx
Instance: sde:sqlserver:xxxxxx
Location: xxxxx
Table: xxxxxx
X Field: LONGITUDE
Y Field: LATITUDE
Has Object-ID Field: Yes

0 Kudos
ABVŠT
by
New Contributor

Hello,

 

Maybe anyone have video how to solve this problem? Tanks

0 Kudos