{"id":852841,"date":"2020-05-18T10:59:31","date_gmt":"2020-05-18T17:59:31","guid":{"rendered":"https:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=852841"},"modified":"2020-05-18T11:26:05","modified_gmt":"2020-05-18T18:26:05","slug":"improve-your-relationship-with-related-records","status":"publish","type":"blog","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-online\/field-mobility\/improve-your-relationship-with-related-records","title":{"rendered":"Improve your relationship with related records"},"author":9912,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_acf_changed":false,"_searchwp_excluded":""},"categories":[23851,23261,22841],"tags":[263932,165702,33141,609631,24031],"industry":[],"product":[36591,36551],"class_list":["post-852841","blog","type-blog","status-publish","format-standard","hentry","category-data-management","category-field-mobility","category-local-government","tag-asset-management","tag-collector-for-arcgis","tag-hosted-feature-layers","tag-inspections","tag-related-tables","product-apps","product-arcgis-online"],"acf":{"short_description":"Leverage related records in ArcGIS Online as part of a start-to-finish asset inspection workflow. ","flexible_content":[{"acf_fc_layout":"content","content":"<p>Working from home for the past couple of months, I have had a daily view of the operations employees that are responsible for the upkeep of the apartment complex where I live. They inspect the same assets week in and week out, but the condition and work performed on them differs each time. The assets have certain properties such as ID, material and type that are unlikely to change, and other properties such as inspection date and work performed that may be different at each inspection. This is a common scenario in many industries but is especially prevalent in maintenance work.<\/p>\n<p>Using related tables in ArcGIS Online, as we collect data points for the same geographic feature over time &#8211; for example, daily inspections &#8211; <em><strong>we can quickly and easily see what our previous values were<\/strong><\/em>. The easiest way to get started <a href=\"https:\/\/doc.arcgis.com\/en\/arcgis-online\/manage-data\/publish-features.htm#ESRI_SECTION1_809F1266856546EF9E6D2CEF3816FD7D\">is with a template from ArcGIS Online.<\/a> For the purposes of this article, let\u2019s say that I am working as a GIS Analyst for my hometown of Eugene, OR and want to streamline manhole cover inspections. To begin setting up for data collection, I\u2019ll select the Manhole Cover Inspections template. The template includes fields in the feature layer that will be the same each time the manhole is inspected, such as cover type and flow direction, and has the inspection schema in the related table.<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":852861,"id":852861,"title":"CreateFeatureLayer_Manhole","filename":"CreateFeatureLayer_Manhole.jpg","filesize":38689,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/CreateFeatureLayer_Manhole.jpg","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-online\/field-mobility\/improve-your-relationship-with-related-records\/createfeaturelayer_manhole","alt":"This image shows selecting the Manhole Inspections feature layer template.","author":"9912","description":"","caption":"","name":"createfeaturelayer_manhole","status":"inherit","uploaded_to":852841,"date":"2020-05-06 19:05:03","modified":"2020-05-06 22:21:05","menu_order":0,"mime_type":"image\/jpeg","type":"image","subtype":"jpeg","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":1274,"height":720,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/CreateFeatureLayer_Manhole-213x200.jpg","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/CreateFeatureLayer_Manhole.jpg","medium-width":462,"medium-height":261,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/CreateFeatureLayer_Manhole.jpg","medium_large-width":768,"medium_large-height":434,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/CreateFeatureLayer_Manhole.jpg","large-width":1274,"large-height":720,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/CreateFeatureLayer_Manhole.jpg","1536x1536-width":1274,"1536x1536-height":720,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/CreateFeatureLayer_Manhole.jpg","2048x2048-width":1274,"2048x2048-height":720,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/CreateFeatureLayer_Manhole-823x465.jpg","card_image-width":823,"card_image-height":465,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/CreateFeatureLayer_Manhole.jpg","wide_image-width":1274,"wide_image-height":720}},"image_position":"center","orientation":"horizontal","hyperlink":"https:\/\/doc.arcgis.com\/en\/arcgis-online\/manage-data\/publish-features.htm#ESRI_SECTION1_809F1266856546EF9E6D2CEF3816FD7D"},{"acf_fc_layout":"content","content":"<p>Now that we have our template published , we\u2019ll <a href=\"https:\/\/doc.arcgis.com\/en\/arcgis-online\/create-maps\/configure-pop-ups.htm\">configure the editing form and pop-up<\/a> to prepare for smooth field data collection. This can be done in the web map or on the hosted feature layer visualization tab. In this case, the editing form and pop-up are already looking good, but we will choose to sort the related records in a descending order on the inspected date and time. There are many more form configuration options <a href=\"https:\/\/doc.arcgis.com\/en\/collector\/android-phone\/help\/form-configuration.htm\">here<\/a> that we won&#8217;t get into today, but are worth looking into as you implement this workflow.<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":852881,"id":852881,"title":"sort_order_related_records","filename":"sort_order_related_records.jpg","filesize":63914,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/sort_order_related_records.jpg","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-online\/field-mobility\/improve-your-relationship-with-related-records\/sort_order_related_records","alt":"This image shows the workflow of sorting related records in descending order by inspection date.","author":"9912","description":"","caption":"","name":"sort_order_related_records","status":"inherit","uploaded_to":852841,"date":"2020-05-06 19:10:09","modified":"2020-05-06 22:21:51","menu_order":0,"mime_type":"image\/jpeg","type":"image","subtype":"jpeg","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":1920,"height":902,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/sort_order_related_records-213x200.jpg","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/sort_order_related_records.jpg","medium-width":464,"medium-height":218,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/sort_order_related_records.jpg","medium_large-width":768,"medium_large-height":361,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/sort_order_related_records.jpg","large-width":1920,"large-height":902,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/sort_order_related_records-1536x722.jpg","1536x1536-width":1536,"1536x1536-height":722,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/sort_order_related_records.jpg","2048x2048-width":1920,"2048x2048-height":902,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/sort_order_related_records-826x388.jpg","card_image-width":826,"card_image-height":388,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/sort_order_related_records.jpg","wide_image-width":1920,"wide_image-height":902}},"image_position":"center","orientation":"horizontal","hyperlink":"https:\/\/doc.arcgis.com\/en\/arcgis-online\/create-maps\/configure-pop-ups.htm#ESRI_SECTION1_09B2E0D22072457AAC8D025377DD7CF9"},{"acf_fc_layout":"content","content":"<p>We can also <a href=\"https:\/\/doc.arcgis.com\/en\/arcgis-online\/create-maps\/organize-layers.htm\">update the layer names<\/a> and <a href=\"https:\/\/doc.arcgis.com\/en\/arcgis-online\/create-maps\/configure-pop-ups.htm\">pop-up titles<\/a> to be even more clear for our field workers.<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":852891,"id":852891,"title":"layer_title","filename":"layer_title.jpg","filesize":5733,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/layer_title.jpg","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-online\/field-mobility\/improve-your-relationship-with-related-records\/layer_title","alt":"This image shows renaming the Manholes Layer and Inspections Table.","author":"9912","description":"","caption":"","name":"layer_title","status":"inherit","uploaded_to":852841,"date":"2020-05-06 19:17:19","modified":"2020-05-06 22:23:53","menu_order":0,"mime_type":"image\/jpeg","type":"image","subtype":"jpeg","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":412,"height":139,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/layer_title-213x139.jpg","thumbnail-width":213,"thumbnail-height":139,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/layer_title.jpg","medium-width":412,"medium-height":139,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/layer_title.jpg","medium_large-width":412,"medium_large-height":139,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/layer_title.jpg","large-width":412,"large-height":139,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/layer_title.jpg","1536x1536-width":412,"1536x1536-height":139,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/layer_title.jpg","2048x2048-width":412,"2048x2048-height":139,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/layer_title.jpg","card_image-width":412,"card_image-height":139,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/layer_title.jpg","wide_image-width":412,"wide_image-height":139}},"image_position":"center","orientation":"horizontal","hyperlink":"https:\/\/doc.arcgis.com\/en\/arcgis-online\/create-maps\/organize-layers.htm"},{"acf_fc_layout":"image","image":{"ID":852901,"id":852901,"title":"related_records_title","filename":"related_records_title.jpg","filesize":5266,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/related_records_title.jpg","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-online\/field-mobility\/improve-your-relationship-with-related-records\/related_records_title","alt":"This image shows configuring the related records pop-up title to show the manhole number.","author":"9912","description":"","caption":"","name":"related_records_title","status":"inherit","uploaded_to":852841,"date":"2020-05-06 19:17:41","modified":"2020-05-06 22:24:38","menu_order":0,"mime_type":"image\/jpeg","type":"image","subtype":"jpeg","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":386,"height":127,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/related_records_title-213x127.jpg","thumbnail-width":213,"thumbnail-height":127,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/related_records_title.jpg","medium-width":386,"medium-height":127,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/related_records_title.jpg","medium_large-width":386,"medium_large-height":127,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/related_records_title.jpg","large-width":386,"large-height":127,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/related_records_title.jpg","1536x1536-width":386,"1536x1536-height":127,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/related_records_title.jpg","2048x2048-width":386,"2048x2048-height":127,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/related_records_title.jpg","card_image-width":386,"card_image-height":127,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/related_records_title.jpg","wide_image-width":386,"wide_image-height":127}},"image_position":"center","orientation":"horizontal","hyperlink":"https:\/\/doc.arcgis.com\/en\/arcgis-online\/create-maps\/configure-pop-ups.htm"},{"acf_fc_layout":"content","content":"<p>Now that the map configuration looks good, we can save the web map and by default it will be available for use in Collector for ArcGIS. We&#8217;re now ready to go inspect some manholes in the field with Collector! I can interactively select a manhole on the map and click the ? icon to access the inspections table. After filling out some fields, such as Inspection ID and the date, I can submit my inspection. See <a href=\"https:\/\/doc.arcgis.com\/en\/collector\/android-phone\/help\/inspect.htm#ESRI_SECTION1_08FD3A4D011B44DF926EC29DC7B3B60E\">this documentation<\/a> for more on inspections with Collector and submitting related reports.<\/p>\n<p>&nbsp;<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":864771,"id":864771,"title":"5ec2c764380d4910783591","filename":"5ec2c764380d4910783591.gif","filesize":585597,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/5ec2c764380d4910783591.gif","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-online\/field-mobility\/improve-your-relationship-with-related-records\/5ec2c764380d4910783591","alt":"This image shows selecting a point and collecting a related report in Collector for ArcGIS.","author":"9912","description":"","caption":"","name":"5ec2c764380d4910783591","status":"inherit","uploaded_to":852841,"date":"2020-05-18 17:35:58","modified":"2020-05-18 17:36:09","menu_order":0,"mime_type":"image\/gif","type":"image","subtype":"gif","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":340,"height":591,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/5ec2c764380d4910783591-213x200.gif","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/5ec2c764380d4910783591.gif","medium-width":150,"medium-height":261,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/5ec2c764380d4910783591.gif","medium_large-width":340,"medium_large-height":591,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/5ec2c764380d4910783591.gif","large-width":340,"large-height":591,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/5ec2c764380d4910783591.gif","1536x1536-width":340,"1536x1536-height":591,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/5ec2c764380d4910783591.gif","2048x2048-width":340,"2048x2048-height":591,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/5ec2c764380d4910783591-268x465.gif","card_image-width":268,"card_image-height":465,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/5ec2c764380d4910783591.gif","wide_image-width":340,"wide_image-height":591}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<p>After completing all our inspections, there needs to be some quality assurance and control (QA\/QC) done. QA\/QC of inspections is an important part of the process and Web AppBuilder is a great tool to accomplish this. I\u2019ve created a <a href=\"https:\/\/doc.arcgis.com\/en\/web-appbuilder\/create-apps\/make-first-app.htm\">Web AppBuilder<\/a> app with the <a href=\"https:\/\/doc.arcgis.com\/en\/web-appbuilder\/create-apps\/widget-edit.htm\">Edit widget<\/a> where the data updates instantly after the inspections are completed and it can be double checked in the office.<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":852941,"id":852941,"title":"RR_Manhole_DataReview","filename":"RR_Manhole_DataReview.gif","filesize":319688,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/RR_Manhole_DataReview.gif","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-online\/field-mobility\/improve-your-relationship-with-related-records\/rr_manhole_datareview","alt":"This gif shows reviewing inspections in Web AppBuilder.","author":"9912","description":"","caption":"","name":"rr_manhole_datareview","status":"inherit","uploaded_to":852841,"date":"2020-05-06 19:32:31","modified":"2020-05-06 22:27:49","menu_order":0,"mime_type":"image\/gif","type":"image","subtype":"gif","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":1910,"height":895,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/RR_Manhole_DataReview-213x200.gif","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/RR_Manhole_DataReview.gif","medium-width":464,"medium-height":217,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/RR_Manhole_DataReview.gif","medium_large-width":768,"medium_large-height":360,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/RR_Manhole_DataReview.gif","large-width":1910,"large-height":895,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/RR_Manhole_DataReview-1536x720.gif","1536x1536-width":1536,"1536x1536-height":720,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/RR_Manhole_DataReview.gif","2048x2048-width":1910,"2048x2048-height":895,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/RR_Manhole_DataReview-826x387.gif","card_image-width":826,"card_image-height":387,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/RR_Manhole_DataReview.gif","wide_image-width":1910,"wide_image-height":895}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<p>Finally, it would be great to share the most pertinent inspection data with local citizens. However, they probably don\u2019t care too much about the granular details of manholes, and we also need to make sure that the layer shared with the public is view-only. A non-editable <a href=\"https:\/\/doc.arcgis.com\/en\/arcgis-online\/manage-data\/create-hosted-views.htm\">hosted feature layer view<\/a> and <a href=\"https:\/\/doc.arcgis.com\/en\/arcgis-online\/create-maps\/configure-pop-ups.htm\">custom pop-up configuration<\/a> showcased in a clean, focused web application, such as my choice of <a href=\"https:\/\/www.arcgis.com\/home\/item.html?id=5df499a60aa0450d966b59e80e9526e2\">Media Map<\/a>, is just the ticket.<\/p>\n<p>Using an Arcade expression, I can bring the last inspection date and status into the feature layer\u2019s pop-up. The Arcade expression uses the $datastore global variable and a SQL query to connect a feature to its related records. You can learn more about configuring pop-ups <a href=\"https:\/\/doc.arcgis.com\/en\/arcgis-online\/create-maps\/configure-pop-ups.htm\">here<\/a>, and more about accessing related records in pop-ups in this <a href=\"https:\/\/community.esri.com\/docs\/DOC-12773-using-featuresetby-functions-in-arcade-to-drill-down-to-other-layers-and-tables\">GeoNet article<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<pre><code style=\"padding: 0.5em;color: #333;background: #f8f8f8\">\r\n<span style=\"color: #998;font-style: italic\">\/\/create the SQL expression to map a feature to its inspections:<\/span>\r\n\r\n<span style=\"color: #333;font-weight: bold\">var<\/span> tbl = FeatureSetByName($datastore,<span style=\"color: #d14\">\"Manhole_Inspection\"<\/span>)\r\n<span style=\"color: #333;font-weight: bold\">var<\/span> code = $feature.GlobalID\r\n\r\n<span style=\"color: #998;font-style: italic\">\/\/the related records are created on GlobalID\/AssetGUID<\/span>\r\n\r\n<span style=\"color: #333;font-weight: bold\">var<\/span> sql = <span style=\"color: #d14\">\"AssetGUID = '\"<\/span> + code + <span style=\"color: #d14\">\"'\"<\/span>;\r\n<span style=\"color: #0086b3\">console<\/span>(sql)\r\n<span style=\"color: #333;font-weight: bold\">var<\/span> inspections = Filter(tbl,sql);\r\n<span style=\"color: #333;font-weight: bold\">var<\/span> total_inspections = Count(inspections)\r\n<span style=\"color: #333;font-weight: bold\">var<\/span> last_inspection_date = <span style=\"color: #d14\">\"\"<\/span>\r\n<span style=\"color: #333;font-weight: bold\">if<\/span> (total_inspections &gt; <span style=\"color: #008080\">0<\/span>) {\r\n    <span style=\"color: #333;font-weight: bold\">var<\/span> ordered_inspections = OrderBy(inspections, <span style=\"color: #d14\">'DateTime DESC'<\/span>)\r\n    <span style=\"color: #333;font-weight: bold\">var<\/span> latest_inspection = first(ordered_inspections)\r\n    <span style=\"color: #333;font-weight: bold\">var<\/span> condition = $feature.CONDITION\r\n    <span style=\"color: #333;font-weight: bold\">var<\/span> latest_date = Text(latest_inspection.DateTime, <span style=\"color: #d14\">'M\/DD\/Y'<\/span>)\r\n    last_inspection_date = <span style=\"color: #d14\">\"was last inspected on \"<\/span> + latest_date + \r\n\t<span style=\"color: #d14\">\".\"<\/span> + TextFormatting.NewLine + <span style=\"color: #d14\">\"\"<\/span> + TextFormatting.NewLine + \r\n\t<span style=\"color: #d14\">\"The condition of the manhole is \"<\/span> + condition + <span style=\"color: #d14\">\".\"<\/span>\r\n}\r\n<span style=\"color: #333;font-weight: bold\">else<\/span> {\r\n    last_inspection_date = <span style=\"color: #d14\">\"has not been inspected yet.\"<\/span>\r\n}\r\n\r\n<span style=\"color: #333;font-weight: bold\">return<\/span> last_inspection_date\r\n\r\n<\/code><\/pre>\n"},{"acf_fc_layout":"content","content":"<p>As a citizen, I can browse to the public application and quickly see the last inspection date and condition of each manhole.<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":864681,"id":864681,"title":"RR_Manhole_pub_facing","filename":"RR_Manhole_pub_facing.gif","filesize":148720,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/RR_Manhole_pub_facing.gif","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-online\/field-mobility\/improve-your-relationship-with-related-records\/rr_manhole_pub_facing","alt":"This GIF displays viewing a point and the formatted pop-up in an interactive web app.","author":"9912","description":"","caption":"","name":"rr_manhole_pub_facing","status":"inherit","uploaded_to":852841,"date":"2020-05-18 17:03:53","modified":"2020-05-18 17:04:35","menu_order":0,"mime_type":"image\/gif","type":"image","subtype":"gif","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":1906,"height":894,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/RR_Manhole_pub_facing-213x200.gif","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/RR_Manhole_pub_facing.gif","medium-width":464,"medium-height":218,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/RR_Manhole_pub_facing.gif","medium_large-width":768,"medium_large-height":360,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/RR_Manhole_pub_facing.gif","large-width":1906,"large-height":894,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/RR_Manhole_pub_facing-1536x720.gif","1536x1536-width":1536,"1536x1536-height":720,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/RR_Manhole_pub_facing.gif","2048x2048-width":1906,"2048x2048-height":894,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/RR_Manhole_pub_facing-826x387.gif","card_image-width":826,"card_image-height":387,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/RR_Manhole_pub_facing.gif","wide_image-width":1906,"wide_image-height":894}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<p>In this workflow, we created a feature service with a layer and related table in ArcGIS Online, authored a web map for data collection, performed an inspection in Collector, QA\/QC\u2019d the inspections, and finally presented the last inspection date and manhole condition to the public in a sleek, interactive web app. The next time field workers go out and do inspections, new records will be created in the related table, creating an inspection history, and the public-facing web app will dynamically update to show the last inspection date.<\/p>\n<p>What assets can you apply this workflow to? Thanks for reading and let me know your thoughts and questions in the comments section below.<\/p>\n"}],"authors":[{"ID":9912,"user_firstname":"Peter","user_lastname":"Klingman","nickname":"PKlingman","user_nicename":"pklingman","display_name":"Peter Klingman","user_email":"PKlingman@esri.com","user_url":"","user_registered":"2019-09-03 14:13:12","user_description":"I'm a Product Advocacy Lead for ArcGIS Online and am interested in all things web GIS. When I'm not working you may find me on a disc golf course or engaging in a lively game of 'chase the treats' with my two cats.","user_avatar":"<img data-del=\"avatar\" src='https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/ProfPicArcGISOnline-213x200.jpg' class='avatar pp-user-avatar avatar-96 photo ' height='96' width='96'\/>"}],"related_articles":"","card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/04\/field-ops-blog-card.png","wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/cars-busy-street-downtown-city.jpg"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v25.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Improve your relationship with related records<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-online\/field-mobility\/improve-your-relationship-with-related-records\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Improve your relationship with related records\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-online\/field-mobility\/improve-your-relationship-with-related-records\" \/>\n<meta property=\"og:site_name\" content=\"ArcGIS Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/esrigis\/\" \/>\n<meta property=\"article:modified_time\" content=\"2020-05-18T18:26:05+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@ESRI\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-online\/field-mobility\/improve-your-relationship-with-related-records#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-online\/field-mobility\/improve-your-relationship-with-related-records\"},\"author\":{\"name\":\"Peter Klingman\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/dc06bba7df15a26012ff0763bad195cc\"},\"headline\":\"Improve your relationship with related records\",\"datePublished\":\"2020-05-18T17:59:31+00:00\",\"dateModified\":\"2020-05-18T18:26:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-online\/field-mobility\/improve-your-relationship-with-related-records\"},\"wordCount\":6,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\"},\"keywords\":[\"asset management\",\"Collector for ArcGIS\",\"hosted feature layers\",\"inspections\",\"Related Tables\"],\"articleSection\":[\"Data Management\",\"Field Operations\",\"Local Government\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-online\/field-mobility\/improve-your-relationship-with-related-records#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-online\/field-mobility\/improve-your-relationship-with-related-records\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-online\/field-mobility\/improve-your-relationship-with-related-records\",\"name\":\"Improve your relationship with related records\",\"isPartOf\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#website\"},\"datePublished\":\"2020-05-18T17:59:31+00:00\",\"dateModified\":\"2020-05-18T18:26:05+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-online\/field-mobility\/improve-your-relationship-with-related-records#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-online\/field-mobility\/improve-your-relationship-with-related-records\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-online\/field-mobility\/improve-your-relationship-with-related-records#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.esri.com\/arcgis-blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Improve your relationship with related records\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#website\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/\",\"name\":\"ArcGIS Blog\",\"description\":\"Get insider info from Esri product teams\",\"publisher\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.esri.com\/arcgis-blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\",\"name\":\"Esri\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png\",\"contentUrl\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png\",\"width\":400,\"height\":400,\"caption\":\"Esri\"},\"image\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/esrigis\/\",\"https:\/\/x.com\/ESRI\",\"https:\/\/www.linkedin.com\/company\/5311\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/dc06bba7df15a26012ff0763bad195cc\",\"name\":\"Peter Klingman\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/ProfPicArcGISOnline-213x200.jpg\",\"contentUrl\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/ProfPicArcGISOnline-213x200.jpg\",\"caption\":\"Peter Klingman\"},\"description\":\"I'm a Product Advocacy Lead for ArcGIS Online and am interested in all things web GIS. When I'm not working you may find me on a disc golf course or engaging in a lively game of 'chase the treats' with my two cats.\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/author\/pklingman\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Improve your relationship with related records","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-online\/field-mobility\/improve-your-relationship-with-related-records","og_locale":"en_US","og_type":"article","og_title":"Improve your relationship with related records","og_url":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-online\/field-mobility\/improve-your-relationship-with-related-records","og_site_name":"ArcGIS Blog","article_publisher":"https:\/\/www.facebook.com\/esrigis\/","article_modified_time":"2020-05-18T18:26:05+00:00","twitter_card":"summary_large_image","twitter_site":"@ESRI","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-online\/field-mobility\/improve-your-relationship-with-related-records#article","isPartOf":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-online\/field-mobility\/improve-your-relationship-with-related-records"},"author":{"name":"Peter Klingman","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/dc06bba7df15a26012ff0763bad195cc"},"headline":"Improve your relationship with related records","datePublished":"2020-05-18T17:59:31+00:00","dateModified":"2020-05-18T18:26:05+00:00","mainEntityOfPage":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-online\/field-mobility\/improve-your-relationship-with-related-records"},"wordCount":6,"commentCount":3,"publisher":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization"},"keywords":["asset management","Collector for ArcGIS","hosted feature layers","inspections","Related Tables"],"articleSection":["Data Management","Field Operations","Local Government"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-online\/field-mobility\/improve-your-relationship-with-related-records#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-online\/field-mobility\/improve-your-relationship-with-related-records","url":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-online\/field-mobility\/improve-your-relationship-with-related-records","name":"Improve your relationship with related records","isPartOf":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#website"},"datePublished":"2020-05-18T17:59:31+00:00","dateModified":"2020-05-18T18:26:05+00:00","breadcrumb":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-online\/field-mobility\/improve-your-relationship-with-related-records#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-online\/field-mobility\/improve-your-relationship-with-related-records"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-online\/field-mobility\/improve-your-relationship-with-related-records#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.esri.com\/arcgis-blog\/"},{"@type":"ListItem","position":2,"name":"Improve your relationship with related records"}]},{"@type":"WebSite","@id":"https:\/\/www.esri.com\/arcgis-blog\/#website","url":"https:\/\/www.esri.com\/arcgis-blog\/","name":"ArcGIS Blog","description":"Get insider info from Esri product teams","publisher":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.esri.com\/arcgis-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization","name":"Esri","url":"https:\/\/www.esri.com\/arcgis-blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png","contentUrl":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png","width":400,"height":400,"caption":"Esri"},"image":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/esrigis\/","https:\/\/x.com\/ESRI","https:\/\/www.linkedin.com\/company\/5311\/"]},{"@type":"Person","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/dc06bba7df15a26012ff0763bad195cc","name":"Peter Klingman","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/image\/","url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/ProfPicArcGISOnline-213x200.jpg","contentUrl":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/ProfPicArcGISOnline-213x200.jpg","caption":"Peter Klingman"},"description":"I'm a Product Advocacy Lead for ArcGIS Online and am interested in all things web GIS. When I'm not working you may find me on a disc golf course or engaging in a lively game of 'chase the treats' with my two cats.","url":"https:\/\/www.esri.com\/arcgis-blog\/author\/pklingman"}]}},"text_date":"May 18, 2020","author_name":"Peter Klingman","author_page":"https:\/\/www.esri.com\/arcgis-blog\/author\/pklingman","custom_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/05\/cars-busy-street-downtown-city.jpg","primary_product":"ArcGIS Online","tag_data":[{"term_id":263932,"name":"asset management","slug":"asset-management","term_group":0,"term_taxonomy_id":263932,"taxonomy":"post_tag","description":"","parent":0,"count":18,"filter":"raw"},{"term_id":165702,"name":"Collector for ArcGIS","slug":"collector-for-arcgis","term_group":0,"term_taxonomy_id":165702,"taxonomy":"post_tag","description":"","parent":0,"count":14,"filter":"raw"},{"term_id":33141,"name":"hosted feature layers","slug":"hosted-feature-layers","term_group":0,"term_taxonomy_id":33141,"taxonomy":"post_tag","description":"","parent":0,"count":8,"filter":"raw"},{"term_id":609631,"name":"inspections","slug":"inspections","term_group":0,"term_taxonomy_id":609631,"taxonomy":"post_tag","description":"","parent":0,"count":9,"filter":"raw"},{"term_id":24031,"name":"Related Tables","slug":"related-tables","term_group":0,"term_taxonomy_id":24031,"taxonomy":"post_tag","description":"","parent":0,"count":3,"filter":"raw"}],"category_data":[{"term_id":23851,"name":"Data Management","slug":"data-management","term_group":0,"term_taxonomy_id":23851,"taxonomy":"category","description":"","parent":0,"count":920,"filter":"raw"},{"term_id":23261,"name":"Field Operations","slug":"field-mobility","term_group":0,"term_taxonomy_id":23261,"taxonomy":"category","description":"","parent":0,"count":616,"filter":"raw"},{"term_id":22841,"name":"Local Government","slug":"local-government","term_group":0,"term_taxonomy_id":22841,"taxonomy":"category","description":"","parent":0,"count":556,"filter":"raw"}],"product_data":[{"term_id":36591,"name":"Apps","slug":"apps","term_group":0,"term_taxonomy_id":36591,"taxonomy":"product","description":"","parent":0,"count":648,"filter":"raw"},{"term_id":36551,"name":"ArcGIS Online","slug":"arcgis-online","term_group":0,"term_taxonomy_id":36551,"taxonomy":"product","description":"","parent":0,"count":2419,"filter":"raw"}],"primary_product_link":"https:\/\/www.esri.com\/arcgis-blog\/?s=#&products=arcgis-online","_links":{"self":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog\/852841","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog"}],"about":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/types\/blog"}],"author":[{"embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/users\/9912"}],"replies":[{"embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/comments?post=852841"}],"version-history":[{"count":0,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog\/852841\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/media?parent=852841"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/categories?post=852841"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/tags?post=852841"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/industry?post=852841"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/product?post=852841"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}