Select to view content in your preferred language

MapViewer field Expressions on Editor only works sometimes

458
0
08-17-2022 06:52 AM
Labels (2)
GustavoMiralesSilva
Occasional Contributor

We have a Hosted Feature Layer to collect some data, to do so, we created a map in MapViewer and added it into an Experience Builder with an editor widget. We MUST collect the X and Y coordinate in the attributes of the data being collected, it makes possible to customize URL hiperlinks that links this to another service.

In MapViewer forms, i've created an expression for the X and Y field, such as:

// Get the X value
var geom = Geometry($feature)
if (IsEmpty(geom)) {
    return null
} else {
    return geom.X
}

 

What i'm about to say next, applies to  Experience Builder and MapViewer.

After opened for the first time, the first record added works perfectly, the calculated coodinates appears on the editor widget and after saved it's there. But is after the first record, it's just doesn't populate the fields anymore, even though  appearing the coordinates in the edit widget, it's not saved on the attributes.

 

I've tried another expressions, without success, like:

// Get the X value
Geometry($feature).X
// Get the X value
var geom = Geometry($feature)
if (IsEmpty(geom)) {
    //Try again
    return Geometry($feature).X
} else {
    return geom.X
}

 

It's the expression? It's an issue? Is there an workarround?

Any help is welcome.

0 Kudos
0 Replies