Select to view content in your preferred language

Arcade exp in Editing Form: Add 1 to last added value

700
3
11-28-2023 06:36 AM
PanGIS
by
Frequent Contributor

Hello!

 

Pretty basic question but I am still learning and it looks huge to me:

 

In an ArcGIS online editing forms I created an expression that concatenate 2 fields.

One is the result of a radio button choice, the other is a field that is supposed to calculate this value:

last imputed integer of the same field +1.
It is a incremental.

I do not manage to do so.

Any tip is appreciated, thanks!

0 Kudos
3 Replies
EDUARDOARDILARINCON
Occasional Contributor

Hi @PanGIS !

Here you have a link  with information and examples about how to use increment operators:
Increment Operators.

If that doesn't work for you it would be helpul to have your code in order to analize it and try to find the best way to achive your goal.

 

Best regards,

Eduardo 😊

0 Kudos
jcarlson
MVP Esteemed Contributor

Do you mean the last calculated value on any other feature? You may need some kind of FeatureSet function and a Filter to grab the most recently edited feature, if that's the case.

- Josh Carlson
Kendall County GIS
0 Kudos
PanGIS
by
Frequent Contributor

Thank you @EDUARDOARDILARINCON and @jcarlson  for you reply

 

my "code" is a very modest count($layer)+1 that works until a feature is deleted so it cannot be a solution.

I need to pick the last value added in a field in the table and add 1 for the feature that I am adding.

If the last  bench has "500" code, the next is going to be 501.
I am not too familiar with the calculations and variables, and the result is that I am more confused than ever.

PanGIS_1-1701272614381.png

PanGIS_2-1701272739947.png

 

I tried to use the solution you suggested and it looks acceptable, 

if I run the expression, the result is correct (see highlighted=501) as the last inputted no. id 500 in that field, but when I add a new feature in the editor I get 1.

I suppose it is somewhere needed that I ask to order by let's say object ID like:

orderBy($feature.newID_web, OBJECTID DESC) and my attempt is a disaster as I don't know how to integrate the orderBy (last screenshot)
 

PanGIS_3-1701273265795.png

PanGIS_6-1701273766854.png

 

PanGIS_4-1701273521945.png

 

 

0 Kudos