Select to view content in your preferred language

Joins, relates, and Enhanced Search Widget for ArcGIS Viewer for Flex 2.5

2767
4
Jump to solution
05-22-2012 02:18 PM
VirginiaSeamster
Occasional Contributor
Hello!

I'm trying to display attributes of two non-spatial tables that are related to a spatial layer in search results generated by the Enhanced Search Widget version 2.5.17f.

My two non-spatial tables (i.e., documentcounty and document) are in a SQL Server database. I've added these tables to an mxd file via a database connection and joined them (i.e., documentcounty joined to document; relationship is many to one). I've then related the non-spatial table with the join (i.e., documentcounty) to a spatial layer (i.e., county) since the relationship between county and documentcounty is one to many. When I publish the mxd as a map service- the joined attributes show up for the documentcounty table, but the relate does not show up for the county spatial layer. I want to be able to display attributes from both of the non-spatial tables in the search results for the spatial layer (search done on county name). Unfortunately- it would be difficult to add a field to the county spatial layer that would enable the document non-spatial table to be related or joined directly to it.

Any suggestions on things I might be doing wrong- for example getting the order of joins/relates wrong- or comments on the feasibility of what I'm trying to do? I'm happy to provide more details if this explanation is unclear.

Thank you!

Virginia
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
AnthonyGiles
Honored Contributor
Virginia,

There is a post on the REST forum that suggests there is a bug when you try to publish a layer that has both a join and a relate:

http://forums.arcgis.com/threads/27212-Relationships-not-showing-up-in-REST-API

Doesnt really help you but it means your not the only one experiencing this problem

Regards

Anthony

View solution in original post

0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus
Virginia,

   I am not sure if what you are attempting is supported. Right now I can not get my head wrapped around what your workflow and situation is. Do you actually have any relates established in ArcMap or are they just joins?
0 Kudos
VirginiaSeamster
Occasional Contributor
Hi Robert:

Thanks for your reply. Sorry my explanation is unclear. I do have a relate set up in ArcMap- but the relate is not showing up when I publish my mxd to a map service- and therefore my reference to it in the enhanced search widget does not work.

Basically I'm linking information in a documents database-which is housed in an mdf file in SQL Server Express- to an ArcSDE geodatabase. I have 2 non-spatial tables (A and B) in the mdf file; and one spatial layer (C) in the geodatabase. Both tables contain attributes that I want to be able to link to/display if I do a search of layer (C). In the mxd, I have set up a join from table B to table A, and set up a relate from layer C to table B. In the esearch config file- I've added layer C and set up an "expression" element to do a search of one of the fields in layer C. I want to then use the "relate" element to set up a way of linking to fields from both tables A and B when the search results are returned.

When I publish a map service from the mxd with this join and relate set up- the tables and results of the join show up in the map service, but the relate does not. So my problem at this point seems to be in going from the mxd to the msd- the relate gets lost in the process.

I hope this clarifies. Any thoughts are much appreciated.

Virginia
0 Kudos
AnthonyGiles
Honored Contributor
Virginia,

There is a post on the REST forum that suggests there is a bug when you try to publish a layer that has both a join and a relate:

http://forums.arcgis.com/threads/27212-Relationships-not-showing-up-in-REST-API

Doesnt really help you but it means your not the only one experiencing this problem

Regards

Anthony
0 Kudos
VirginiaSeamster
Occasional Contributor
Thank you for the response Anthony.

Misery does love company.

Virginia
0 Kudos