AnsweredAssumed Answered

how to query related table in offline geodatabase

Question asked by fimpe001 on Feb 18, 2016
Latest reply on Mar 9, 2016 by fimpe001

When I query a related (non-spatial) table in an offline geodatabase the relatedResults object is not what I would expect. Can somebody help me understand what I'm doing wrong in the below code? Or perhaps post a code sample of how to query related records in an offline geodatabase? Thank you!


Here is what I'm doing:


//a runtime geodatabase with a points layer an a related table

    Geodatabase {

        id: gdb2




// set up the query parameters. I know that related records exist for a point feature with ObjectID = 2, I verified by converting the runtime gdb to file geodatabase with ArcMap

   QueryRelatedRecordsParameters {

        id: relatedQueryParam

        outFields: ["OBJECTID"]

        relationshipId: 0

        objectIds: ['2']



// then I execute queryRelated



// then onQueryRelatedStatusChanged I access the relatedResults

GeodatabaseFeatureTable {

        id: localPointsTable

        geodatabase: gdb2.valid ? gdb2 : null

        featureServiceLayerId: 0

        onQueryRelatedStatusChanged: {

            console.log(queryRelatedStatus) // returns '1' (QueryRelatedStatusInProgress) , then '2' (QueryRelatedStatusCompleted)

    console.log(relatedResults) // this returns '[object Object]'

    console.log(relatedResults.json) // this returns 'undefined'