Select to view content in your preferred language

accessing fields with periods in field names

2714
3
Jump to solution
02-01-2012 01:13 PM
DennisAkins
Emerging Contributor
I issue a query from a layer in my map service that has a join to a table in SQLServer.  Typically I can get the value by using a construct such as 'result.features[0].attribute.fieldID'  However, the field names in the joined table have names such as "dbasename.user.fieldname"  If I use the periods in my previous construct like 'result.features[0].attribute.dbasename.user.fieldID' it of course will not run. 

What is a quick and easy way to get around the dots in the field names?
0 Kudos
1 Solution

Accepted Solutions
KellyHutchins
Esri Frequent Contributor
Try this instead:

result.features[0].attributes['dbasename.user.fieldID']


I issue a query from a layer in my map service that has a join to a table in SQLServer.  Typically I can get the value by using a construct such as 'result.features[0].attribute.fieldID'  However, the field names in the joined table have names such as "dbasename.user.fieldname"  If I use the periods in my previous construct like 'result.features[0].attribute.dbasename.user.fieldID' it of course will not run. 

What is a quick and easy way to get around the dots in the field names?

View solution in original post

0 Kudos
3 Replies
KellyHutchins
Esri Frequent Contributor
Try this instead:

result.features[0].attributes['dbasename.user.fieldID']


I issue a query from a layer in my map service that has a join to a table in SQLServer.  Typically I can get the value by using a construct such as 'result.features[0].attribute.fieldID'  However, the field names in the joined table have names such as "dbasename.user.fieldname"  If I use the periods in my previous construct like 'result.features[0].attribute.dbasename.user.fieldID' it of course will not run. 

What is a quick and easy way to get around the dots in the field names?
0 Kudos
AhmadLibda
Occasional Contributor

how to access it in popup template when using $feature ?

0 Kudos
DennisAkins
Emerging Contributor
Excellent!  That worked perfectly.
0 Kudos