Select to view content in your preferred language

pulldata works on some records but not others from public feature class

944
7
Jump to solution
12-12-2023 10:56 AM
EricaNova
Frequent Contributor

I'm using the pulldata calculation in Survey123 Connect to populate a form with the lower and single tier municipality of the geopoint question in my survey, ${test_loc}.

I'm using the publicly available layer from my organization: https://ws.lioservices.lrc.gov.on.ca/arcgis2/rest/services/LIO_OPEN_DATA/LIO_Open03/MapServer/14

 In my XLSX form, the calculation field is filled with the following text to grab the municipal name short form from that layer:

pulldata("@layer", "getValueAt", "attributes.MUNICIPAL_NAME_SHORTFORM", "https://ws.lioservices.lrc.gov.on.ca/arcgis2/rest/services/LIO_OPEN_DATA/LIO_Open03/MapServer/14", ${test_loc})

However, something strange is happening. If I place my geopoint in, say, Pembroke Ontario, the field gets filled: "PEMBROKE". If I put my geopoint in Peterborough Ontario, the field remains empty.

What's going on here? Peterborough and Pembroke both have very similar looking entries in that layer, and the layer has queries enabled... 

Thanks for any hints you might have.

 

0 Kudos
1 Solution

Accepted Solutions
EricaNova
Frequent Contributor

My organization responded to me and said, 

“Certain parts of the municipality data can be trying to return very detailed geometry results (i.e. shoreline river borders). Can try not returning geometry from the web request and see if that works. Add the following red text (?returnGeometry=false) to the end of the Service call URL: https://ws.lioservices.lrc.gov.on.ca/arcgis2/rest/services/LIO_OPEN_DATA/LIO_Open03/MapServer/14?ret...

I am skeptical that this is actually the issue, as the three areas I tested (Peterborough, Barrie, and Brockville) do not look very complex, but I tried their suggestion.

After publishing with the fix:

  • the pulldata request does not work when testing in the Survey123 Connect program on my desktop
  • the pulldata request does work when testing in an actual survey!

View solution in original post

0 Kudos
7 Replies
DougBrowning
MVP Esteemed Contributor

Based on your examples I think it is because Peterborough returns just 1 record and Pembroke is returning 3.  This probably means there is a list returned if 3 and not a list for the one maybe?  That would mess up the parsing.  I would think the multiple list would trip it up not the single result.  Sorry not sure and no idea how to fix.  But I will take a close look at the JSON returned.

DougBrowning_0-1702407961044.png

DougBrowning_1-1702407970391.png

 

0 Kudos
EricaNova
Frequent Contributor

Thanks for digging, @DougBrowning . However, shouldn't my request only select one of those records from Pembroke with a geopoint? E.g., my point only falls in one of Pembroke's features (selected), in the middle of town:

EricaNova_0-1702408334753.png

 

0 Kudos
EricaNova
Frequent Contributor

@DougBrowning I thought your hunch was correct - I tried Barrie (1) vs Belleville (3) and Barrie does not work. However, Brampton (1 record) works, and Brockville (3) does not.

0 Kudos
EricaNova
Frequent Contributor

@DougBrowning curiously, a simple intersect with a test layer and this particular layer did not work in Pro.

EricaNova_0-1702492382925.png

However, the same error occurred with another similar layer from my organization that IS working with the pulldata command, so maybe a red herring.

0 Kudos
DougBrowning
MVP Esteemed Contributor

Weird I wonder if it is corrupted or slow?  I looked at this for a but but I dont see anything.

0 Kudos
EricaNova
Frequent Contributor

@DougBrowning , FYI - I'm going to ask my organization about this layer. I just spoke with the layer maintainer, who gave me another version of this feature class to test (hosted on AGOL, rather than via a Server Service). The other version of the data (which should be exactly the same) works. Something fishy going on but getting closer to a resolution.

EricaNova
Frequent Contributor

My organization responded to me and said, 

“Certain parts of the municipality data can be trying to return very detailed geometry results (i.e. shoreline river borders). Can try not returning geometry from the web request and see if that works. Add the following red text (?returnGeometry=false) to the end of the Service call URL: https://ws.lioservices.lrc.gov.on.ca/arcgis2/rest/services/LIO_OPEN_DATA/LIO_Open03/MapServer/14?ret...

I am skeptical that this is actually the issue, as the three areas I tested (Peterborough, Barrie, and Brockville) do not look very complex, but I tried their suggestion.

After publishing with the fix:

  • the pulldata request does not work when testing in the Survey123 Connect program on my desktop
  • the pulldata request does work when testing in an actual survey!
0 Kudos