Select to view content in your preferred language

Arcade expression works in ArcPro but not in Portal Web Map

297
0
02-27-2024 11:23 AM
Labels (1)
MonicaBeaton
New Contributor III

Hello, for context, we have a 10.9.1 Enterprise federated with Portal and I am using ArcPro 2.9.10.

Our coder authored an expression for a pop up of a civic address point to get data from a related table (although the relationship class is moot). The expression works in an ArcPro project but not when I use the exact same data in a web map in Portal.

Any thoughts on why this might be? The point feature class is CivicPt that has the pop up. It has a matching field with the CA_Civtab table called MUCIVID. BU_CODE is another field in the same table we want to retrieve after searching for the row with the same MUCIVID as the selected point.

The Arcade code is below:


//get extra civic data from CA_civtab table

var tbl = FeatureSetByName($datastore,"CA_civtab")
Console(Count(tbl))

//get the actual civic of interest from the civic layer (points) using the MUCIVID
var CivicID = $feature.MUCIVID
Console(CivicID)

//create sql querry
var sql = "MUCIVID = '" + CivicID + "'"
Console(sql)

//filter the table based on the MUCIVID of interest (sql), call the result related_record
var related_record = Filter(tbl, sql)
console(related_record)
//this console returns: object, FeaturesSet

///determine how many related records there are
var cnt = Count(related_record)
Console("cnt=" + cnt)
//count does return one related record here (yay!)
//create a variable (history) to store the data of interest for the related record

var history = ""
if (cnt > 0) {

for (var x in related_record) {
var txt_BU_CODE = Text(x.BU_CODE)
history += txt_BU_CODE + TextFormatting.NewLine
Console(history)
}}
else { history = "No Data Available"

}

return history

0 Kudos
0 Replies