Select to view content in your preferred language

Calculated Expressions not populating right away when form loads

510
1
Jump to solution
04-27-2022 06:09 AM
Larry
by
Occasional Contributor

My Field Maps app has about 15 fields in the smart form. I am trying use Calculated Expressions to populate my easting, northing and date fields with:

var sGeo = Centroid($feature)
return sGeo.x

var sGeo = Centroid($feature)
return sGeo.y

// Todays_Date
if (IsEmpty($feature["Date"])) {
return Now()
}
else {
return
}

 

The code seems to work fine but when the form loads is does not always populate right away or not at all.

Some times I have to fill in some of the other fields before they populate. It seems to be hit and miss which other fields I have to fill in that triggers the calculated expressions to work, if at all. Also the fields that I am expecting to autopopulate seem to have 2 dashes "--" that pulse until they fill in.

It does not seem to matter if I have any conditional visibility turned on.

I am using Android 22.1.2, 22.1.1 and IOS 22.1.0

Is there some trigger that I am missing or is there something else I am doing wrong?

Thanks, Larry

0 Kudos
1 Solution

Accepted Solutions
Larry
by
Occasional Contributor

I solved my problem, Field Maps did not like the if statement in calculated expression for my date field.

 

View solution in original post

0 Kudos
1 Reply
Larry
by
Occasional Contributor

I solved my problem, Field Maps did not like the if statement in calculated expression for my date field.

 

0 Kudos