ArcGIS Feature Table关联表填充字段及streetName列不显示问题咨询
Let's walk through why your streetName column isn't appearing in the Feature Table, even with related records enabled, and how to populate it using your associated table.
First, Understand the Core Issue
The showRelatedRecords: true setting only enables a panel to display related records separately—it doesn’t automatically pull fields from the related table into the main Feature Table columns. If streetName lives in your associated table (not the main feature layer linked to the Feature Table), your current configuration won’t render it because:
- The main Feature Layer doesn’t return related table fields in its
outFields. - The Feature Table can’t natively merge related fields into its primary grid without custom code.
Step-by-Step Fixes
1. Verify Where streetName Resides
First confirm:
- Is
streetNamea field in your main feature layer, or only in the related table?- If it’s only in the related table: You’ll need to add it as a temporary field to your main layer (client-side) and populate it via association queries.
- If it’s in the main layer: Double-check it’s not accidentally hidden or excluded in your config.
2. Add streetName to the Main Layer (If It’s a Related Table Field)
If streetName lives in the related table, add it to your feature layer’s field definition before initializing the Feature Table:
// Add the streetName field to your feature layer's schema (client-side) featureTableLayer.fields.push({ name: "streetName", type: "string", alias: "Име на улица (општина)" });
3. Populate streetName Using Related Records
Use the show-related-records event (or the Feature Table’s load event) to query related records and update the streetName field for each main table record:
myFeatureTable.on("show-related-records", async (evt) => { // Get selected records from the main Feature Table const selectedRecords = myFeatureTable.getSelectedRecords(); for (const record of selectedRecords) { // Query related records (replace "<YOUR_RELATIONSHIP_NAME>" with your actual relationship name) const relatedResults = await record.queryRelatedRecords("<YOUR_RELATIONSHIP_NAME>"); // Extract streetName from the first related record (adjust logic if multiple related records exist) const relatedRecords = relatedResults["<YOUR_RELATIONSHIP_NAME>"]; if (relatedRecords && relatedRecords.length > 0) { record.attributes.streetName = relatedRecords[0].attributes.streetName; } } // Refresh the Feature Table to show the updated streetName values myFeatureTable.refresh(); });
4. Double-Check Your Feature Table Config
Ensure your existing config doesn’t block streetName:
- Confirm
streetNameis included inoutFields(you already have this covered). - Make sure
streetNameisn’t listed inhiddenFields(your currenthiddenFieldsonly includesobjectidandglobalid, which is fine). - Verify the
fieldInfosentry forstreetNamehaseditable: true(you have this set correctly).
Additional Checks
- Test your relationship query separately to ensure it returns the expected
streetNamevalues. - If
streetNameis a calculated field in the related table, confirm the service exposes it in itsoutFields.
内容的提问来源于stack exchange,提问作者Novica Josifovski

