Concat works in Survey123 but not in ArcGIS Online

906
5
Jump to solution
12-16-2021 04:15 AM
Niklasg
New Contributor II

Hi,

I have written a calculation in my Survey123 under the calculation coloumn looking like this: concat(${ChainageKilometer}, "+", ${ChainageHundred}, ${ChainageTen}, ${ChainageMeter})

It combines the integer questions and adds a "+" between them. The result is written to a text question. In the Survey123 app it works perfectly, and I can send the answer, however in the attributetable when the answer is submitted, the attribute is empty. Any suggestions to what I can change to make it work?

Picture: Setup in Excel

Niklasg_1-1639656613607.png

Picture: Look in the Survey123 app.

Niklasg_0-1639656580770.png

Picture: Empty attribute information when published to ArcGIS Online

Niklasg_2-1639656746921.png

Thank you,

Niklas

 

0 Kudos
1 Solution

Accepted Solutions
DougBrowning
MVP Esteemed Contributor

Oh so he wants the + in there.  I think the web is more picky  and will not auto convert int so I would try 

concat(string(${ChainageKilometer}), "+", string(${ChainageHundred}), string(${ChainageTen}), string(${ChainageMeter}))

hope that does it

View solution in original post

5 Replies
jcarlson
MVP Esteemed Contributor

Just checking the obvious: "start koordinat" is a text field, right?

Can you turn on your browser's developer tools and watch the Network tab to see what the actual request is that's being sent?

- Josh Carlson
Kendall County GIS
0 Kudos
DougBrowning
MVP Esteemed Contributor

If you want the first 2 to add then you cannot put the + in quotes that is just text then.

I think you want this.  but it would be ugly with all 3 numbers just right next to each other.

concat(${ChainageKilometer} + ${ChainageHundred}, ${ChainageTen}, ${ChainageMeter})

Confused as to what you want now.

jcarlson
MVP Esteemed Contributor

I would assume it's for some kind of road-related thing. "Distance along the road" in highway plans is often shown in that sort of format.

jcarlson_0-1639671600120.png

 

- Josh Carlson
Kendall County GIS
0 Kudos
DougBrowning
MVP Esteemed Contributor

Oh so he wants the + in there.  I think the web is more picky  and will not auto convert int so I would try 

concat(string(${ChainageKilometer}), "+", string(${ChainageHundred}), string(${ChainageTen}), string(${ChainageMeter}))

hope that does it

Niklasg
New Contributor II

Hi guys,

Thanks for your help.

Putting your suggested solution "concat(string(${ChainageKilometer}), "+", string(${ChainageHundred}), string(${ChainageTen}), string(${ChainageMeter}))" into the calculation field did the trick!

 

Best regards

Niklas

0 Kudos