Rename related tables in Web AppBuilder / attribute table widget

4255
3
05-16-2016 11:46 AM
C_EHoward
Occasional Contributor III

Someone else posted this question a few days ago and it was deleted from Geonet, but I still need an answer so I am posting again......basically, I want to know how to make sure my SDE tables that are related tables can show the alias name I have specified in the web map, MXD and GDB. It does not seem to matter where I make a 'nice' name it always defaults back to the ugly SDE name. Bonus if someone can tell me a way to let the user choose which related table to open (as in the web map).  Original post below

"I have a related table (one to many relationship) in my web app that works fine, with one minor but annoying issue - when the related table pops up, the name includes the SDE file location (i.e. databasename.DBO.relatedtablename). I have tried renaming the table in ArcMap and in the web map - in both cases, it works fine. But once I bring the map into AppBuilder, it reverts back to the name in SDE. The only place I can find this original name is in the feature service rest end point, where it is listed in the table layer under "Relationships". Has anyone else run into this problem and/or does anyone have any ideas on how to fix it?"

3 Replies
RobertScheitlin__GISP
MVP Emeritus

C E,

  In the AttributeTable widgets Widget.js file find line 745 and change it to:

json.title = "Related - " + relationShip.shipInfo.name || relationShip.name;

from:

json.title = relationShip.name;

C_EHoward
Occasional Contributor III

Thanks Robert. Yet another reason I should import my online app into the developer version

I contacted support about this and there is indeed a bug for this behavior:

BUG-000091971: Table aliases for related tables set in the web viewer are not honored in the Web AppBuilder for ArcGIS applications.

I hope the Esri developers appreciate the work you have done identifying the code that should be altered! And then implement the change in the online version way sooner than the 'assigned' status currently tied to the bug.

In the meantime, I will check this out in the developer version. Thanks again

0 Kudos
AnthonyClark3
New Contributor II

The Table name that is used when you click "Show Related Records" from a pop-up is based on the label you give it when you create the Relationship Class in ArcMap / ArcCatalog. It does default to the format you specified, "i.e. databasename.DBO.relatedtablename" but you can change it. The screenshot below shows default on the left, and a cleaner label on the right.

If you plan on including the Table in your in the Web App Layer List, I would consider giving the Relationship Class Label a unique suffix (see screenshot on the right). That way if you have both opened in the Attribute Table, you can tell which table is which.

RelationshipClass_Label.jpg