Pulling Related Records with Arcade

Поделиться
HTML-код
  • Опубликовано: 20 июн 2021
  • Ever wanted to click on an asset in a map and see data from its related table in the pop-up? Arcade makes this possible (and no you don't need to be an experienced programmer)! Here, we'll grab a simple code from the Esri Community, formally known as GeoNet, and walk through how to configure it for our pop-up needs!
    Don't know: what related tables are, how to build them, or how to publish them to ArcGIS Online? No worries! This video has you covered: • Inspection Workflows P...
    Learn about other workflows, like letting field crews report issues they see in the field: • Map Change Request Tem...
    Here's the Esri Community code used in the video that you can manipulate (look for XanderBakker's post from 12/12/2019): ow.ly/ZSzw50Ffi52
    Learn how Esri supports the water industry: ow.ly/oh5f50Ffi9F
    For more information, please visit: ow.ly/7Ghb50FfibT
    ---------------------------------------------------------------------------------------------------
    Follow us on Social Media!
    Twitter: / esri
    Facebook: / esrigis
    LinkedIn: / esri
    Instagram: / esrigram
    The Science of Where: www.esri.com
  • НаукаНаука

Комментарии • 12

  • @UFCUEAU
    @UFCUEAU 3 года назад +1

    Great explanation! Looks super simple to implement, too.

  • @despawn7663
    @despawn7663 Год назад +1

    Still baffled that basic relational visualization support needs an arcade expression and is not built into the UX. The solution still works.

  • @a2zPhantom
    @a2zPhantom 2 года назад

    How do we show the related tables attachment with the current inspection?

  • @nwasserm
    @nwasserm 2 года назад

    Where do you add in a "no records" return when there are no related records to sort?

  • @coaitdepartment1671
    @coaitdepartment1671 2 года назад

    I'm going to try this, but I'll just ask here...can we render symbology by an attribute in the related table?

    • @ericwagner5794
      @ericwagner5794 2 года назад +2

      Hi CoA IT Department! Great question!
      If you're using ArcGIS Online (or Enterprise 10.9+), it's possible, it just cant be done with Arcade code.* I recommend taking a look at the "Join Features" tool in the Map Viewer Classic analysis tools. This tool can create a new hosted view that joins together your parent feature with the related table that can be used to drive symbology dynamically. I actually think this is ArcGIS Online's best kept secrets!
      This new view layer that contains the attributes of the parent and the related table can then be added to any map in the old or new Map Viewers and symbolized like any layer (normal style options or Arcade). I made a video about it: ruclips.net/video/gqC-EEw3nxY/видео.html
      Look at about 6 minutes and 40 seconds. Although this video is apart of a larger workflow, it'll still show how to configure the tool using your related fields. My example shows the use of a Global ID field and GUID field. If you used different fields when building your relationship class in ArcGIS Pro, it's fine to use those instead. Also, take a look at my comments to Jennifer Goldman in that video (she posted a few times). I provided some additional ideas and thoughts as to what is possible when you drive symbology with related records.
      Hope this helps!
      *In web maps, the ability to pull data from the related table to the parent is driven by the arcade "FeatureSetBy" function. While this can be used in pop-ups to pulled related data (as shown in this video), it cannot be used for symbology or labels. That's why I recommended the Join Features tool.

    • @keeponkeepinon76
      @keeponkeepinon76 2 года назад

      @@ericwagner5794 BUT when you use the Join in the Analysis tools, you lose your attachments.

    • @69thunder7
      @69thunder7 5 месяцев назад

      yep - use the same code as an arcade expression in the symbology properties. then symbolize on the custom field.

    • @saintuk70
      @saintuk70 4 месяца назад

      @@69thunder7 you can't do that for relationship classes.

    • @saintuk70
      @saintuk70 4 месяца назад

      @@ericwagner5794 I've used this in the past, but it's not the best of solutions at all. Used Join to symbolise 15000 gully points and their related inspections over time, you gain one thing by lose another and then have to work around that to provide additional info. I just wish ESRI would expand Style Expressions to related features.

  • @DawnScott-bb7nk
    @DawnScott-bb7nk Год назад

    Hi Eric, these videos are the best. Thank you! I am getting an error in my OrderBy expression and the new version of Arcade doesn't seem to like it. Here's my code from your video:
    var relatedrecords = OrderBy(FeatureSetByRelationshipName($feature, "SE_PIPES_MAINT"),"DATE_CLEANED DES");
    var cnt = Count(relatedrecords);
    var relatedinfo = "";
    if (cnt > 0) { var info = First(relatedrecords)};
    relatedinfo = " (" + Text(ToLocal(info.DATE_CLEANED), "MM/DD/Y") + ")";

    //IIf(DateDiff(now, "DATE_CLEANED", "years") < 5, "Cleaned", "Not Cleaned")
    I'm trying to symbolize my sewer pipes based on the year they were cleaned. But the OrderBy expression does not work. Any ideas?

    • @saintuk70
      @saintuk70 4 месяца назад

      It's not the OrderBy expression that's not working, unfortunately/annoyingly you can symbolise by a related table attribute. You'll notice that the FSbyRel is not supported when creating an expression in styles.
      What I do is, in a latest inspection summary, use hex codes as a variable and colour certain attributes accordingly. Obviously not as good as seeing the symbols.