Select to view content in your preferred language

indexed-repeat to pull individual layer elevation data, to view in 3D scenes

5770
10
Jump to solution
03-05-2021 02:57 PM
NKneisel
Emerging Contributor

Hi, 

I'm a practicum student looking at ways to visualize snow, soils, geology, water data using elevations.

Using the repeat function for my layer data, and need to "pull data" from each elev_layer field from my 'snowlayers' repeat into my main form to visualize on my 3D by layer.  Also, I'd want to use the phot per-layer, but that's after I get this step done.

Anyway, I can use Sum(), Count(), Max-Min, Once etc. 

But indexed-repeat(${elev_layer}, ${snowlayers}, 1) only gives me a -1, -2 for each index 1, 2, for repeat I'm trying to access elev_layer integer data from.

 

NKneisel_0-1614984903614.png

Tried in both the repeat and outside repeat to see if that gives a different value, but it's the same.

NKneisel_1-1614984946173.png

 

Is there a step I'm missing?

 

0 Kudos
1 Solution

Accepted Solutions
Jim-Moore
Esri Regular Contributor

Hi @NKneisel the strange text that's being displayed for the note question is what I'm seeing when opening this survey in a pre-3.12 version of the field app. Here's how it looks in 3.10 versus 3.12:

Jim-Moore_0-1616373195543.png

Also the menu option to update Connect no longer appears in later versions, and the main menu now looks different to what's shown in your screenshot, which suggests you're still running an older version?

Just to double-check, could you please confirm the version number in Connect and field app on the About screen? Latest build numbers are field app 3.12.277 and Connect 3.12.232.

Best, Jim

View solution in original post

0 Kudos
10 Replies
Jim-Moore
Esri Regular Contributor

Hi @NKneisel if possible, could you please share your XLSForm so I can take a closer look? From your screenshot it looks like the elev_layer1a calculation contains invalid syntax, i.e. ${snowlayers}, 1)

Thanks, Jim

0 Kudos
NKneisel
Emerging Contributor

Hey Jim,

I'm able to get the text value for 'lyr_dpth' for the layer I want, when I use selected-at(${lyr_dpth}, position(..)-1), after I use a repeat_count of: count-selected(${lyr_dpth})

But my elementary understanding fails on getting an indexed repeat integer value for the same layer.

NKneisel_0-1615575324553.png

NKneisel_1-1615575513511.png

 

However, when I try for an Integer value, I get a -1, for an index of '1'; or --1, for index -1.

For an integer value, there must be a index aspect I am missing for the indexed-repeat to call the value of lyr_depth index 1, 2, 3, 4, 5 etc, to visualize in 3D.

 

Currently, I'm just jenking the repeat structure, turning it into a feature layer by putting the same geo-point inside the repeat, and defaulting the xy to the original. This has benefits, but it also has some disadvantages for displaying layered data in 3D.

NKneisel_3-1615575792144.png

 

NKneisel_2-1615575611637.png

 

 

0 Kudos
Jim-Moore
Esri Regular Contributor

Hi @NKneisel thanks for sharing your XLSForm and the additional info. Looks like an interesting project! I'm still not 100% on the objectives for the form so my apologies if I've missed something, but here are a few suggestions that hopefully will assist you with your form design. I've attached an XSLX file demonstrating some of these calculations.

  • The repeat_count sets the number of repeat records to display in the form. The lyr_depth question used in the repeat_count expression is inside the repeat, so when opening this form the repeat is inaccessible (has a null repeat count so zero records are shown).
  • The repeat count uses count-selected(${lyr_dpth}). The lyr_depth question is decimal; however, the count-selected() function works with select_one, select_multiple, and file attachment questions only. 
  • Similarly, the selected-at() function used for the lyr_depths note only works with select_multiple questions. To return the index of a repeat, use position(..) on its own inside a repeat.
  • There's a default and a calculation for lyr1depth - this should be one or the other. To return the lyr_depth from the first repeat record, the calculation for this question could be indexed-repeat(${lyr_dpth}, ${lyr_calcs_rpt}, 1). Note that the repeat index number must be 1 or greater (i.e. the first record in a repeat is numbered 1, the second record is 2, and so on). You then don't need the additional calculate question.
  • The required_message is 'yes' for some questions. This column contains the text that is displayed when you submit the form and have not completed a required question. You could set required to 'yes' and then add a required_message, e.g. "You must enter a depth for this question." Note that a required/required_message shouldn't be used on a readonly question because the value cannot be modified by the user.

For more info on repeats, please see this blog post and documentation. For more info on functions, please see Formulas.

Hope this is useful. Best, Jim 

0 Kudos
NKneisel
Emerging Contributor

Appreciate the feedback!  

Yes, sadly I previously tried the options you suggested with no luck.

I am trying to utilize the integer for the 'lyr_dpth' field both inside and outside the repeat structure.  This is to auto-fill a layer depth inside the repeat and to use the layer depths for 3D layer symbology with photos of each layer outside the repeat (3D scenes don’t symbolize repeat tables unless I ‘jenk-them’ into feature classes using illegal auto-filled hidden geo-points).

  • Funny part is, I get a -1 value (inside and outside the repeat) for any integer or note field using an indexed-repeat(${lyr_dpth}, ${lyr_calcs_rpt}, 1). 
    • Sorry about the -1 index.  It was just to show that I tried it, and it returned a –1.
  • Funnier part is, I do get the get the text value for 'lyr_dpth' (representing desired integer value) when using the selected-at(${lyr_dpth}, position(..)-1), and layer_count: count-selected(${lyr_dpth})

Tried your version, and the indexed repeat value still displays -1, for 'lyr_dpth' both on the published and unpublished side of Survey 123 Connect for the ‘lyr_dpth’ integer I was trying to get. 

NKneisel_1-1615823014563.png

NKneisel_0-1615823187006.png

 

 

All I know about indexed-repeats, is if it can’t find the index, it returns a -1.  Setting the layer_count seems to return a value.  Usually, the repeat structure is as you said, so index 1, gives you the first value, 2 the second…  Unfortunately, my index of 1 gives -1, 2 gives -2. 

Maybe I am missing a repeat count somewhere for my indexed repeat to call from?

Pulling an integer elevation would be very useful in Geology, to Soils, Water, Ice, and Snow core visualization in 3D with photo's per layer.  

I'm just hoping to get a non -1 value to be returned for an indexed repeat.  My rookie skills can return a value in excel, but no success in Survey 123.  I must be missing one very valuable step?

Nathan

Attached both of our files.

 

 

0 Kudos
Jim-Moore
Esri Regular Contributor

Hi Nathan, apologies I should've confirmed this earlier but which versions of the Survey123 field app and Connect are you using? Support for the indexed-repeat() and position(..) functions was introduced at 3.12. You can download the latest from app stores and the Survey123 Resources page. Please let me know what version you're on and we can take it from there!

Best, Jim

0 Kudos
NKneisel
Emerging Contributor

Hi Jim,

Yes, I've been using the latest.

Downloaded the latest to triple-check.

Were you able to get the layer depth integer using this method of a note for position(..)?

I tried switching the integer for a calculate, but that did not work either.

Did this work on your end?

NKneisel_0-1616169200851.png

Still getting the same result:

NKneisel_1-1616169805344.png

 

0 Kudos
Jim-Moore
Esri Regular Contributor

Hi @NKneisel the strange text that's being displayed for the note question is what I'm seeing when opening this survey in a pre-3.12 version of the field app. Here's how it looks in 3.10 versus 3.12:

Jim-Moore_0-1616373195543.png

Also the menu option to update Connect no longer appears in later versions, and the main menu now looks different to what's shown in your screenshot, which suggests you're still running an older version?

Just to double-check, could you please confirm the version number in Connect and field app on the About screen? Latest build numbers are field app 3.12.277 and Connect 3.12.232.

Best, Jim

0 Kudos
NKneisel
Emerging Contributor

OMG, no way.

I downloaded and re-installed it, but maybe I'm not using the latest form or maybe I have to completely uninstall and re-install.

Regardless, It's so great to have a community to troubleshoot these small errors while we're all working remotely!  Getting this working will increase the functionality immensely!

Thanks, Jim for your patience!

Jim-Moore
Esri Regular Contributor

Hi Nathan, good to hear we're getting there!

Note that a few releases back our product name changed from "Survey123 for ArcGIS" to "ArcGIS Survey123" and the name of the install directory was updated accordingly, so it is possible to have an older version and a newer version installed on a desktop machine at the same time. As an example, the old and new install directories for Connect on Windows are as follows:

  • Prior to name change: C:\Users\<username>\Applications\ArcGIS\Survey123ConnectforArcGIS
  • After name change: C:\Users\<username>\Applications\ArcGIS\ArcGISSurvey123Connect

More info on installation here.

Note that from 3.12 Survey123 supports 'over the top' installations (i.e. without having to uninstall the previous version first). For older versions you must uninstall and then reinstall.

Best, Jim

0 Kudos