Attribute Rules and Integromat Survey123 modules

426
5
Jump to solution
02-10-2021 07:50 AM
ShelbyZelonisRoberson
Occasional Contributor II

I've created a public survey in Survey123 (Enterprise/Portal version) in which a user can input an address via geopoint and then submit the survey. There is a hidden field in the survey called District. Upon survey submittal, I have an attribute rule set up via ArcGISPro that immediately calculates the District that the address falls within and edits the District field in the feature class with this correct district value. (The survey data is based on a feature class in a SQL EGDB that is registered with my Portal so that's how I'm able to do this).

In Integromat, I want to be able to watch for the survey submittal and then create a report. This seemed easy....but my problem is I need the calculated District field value to show up in the report. The only options I seem to have to populate the report are from the "Watch Survey" module, which has a null District field because it's null immediately upon submittal, even though the feature class gets populated via attribute rule very shortly after. I tried a bunch of workarounds (sleep tool for 30 secs after watch survey, watch for Edit instead of Add) but the problem I'm running into is that I need to be able to choose the District field from the survey feature class after it is edited, and not the immediate survey input values that are available in the "watch survey" module.

Help?! I feel like I'm so close but so far.

*NOTE* I originally was doing this with custom javascript in my survey, which worked great because the District field populated BEFORE survey submittal. Unfortunately this survey has to be public so I can't use that method. 😞 

 

0 Kudos
1 Solution

Accepted Solutions
IsmaelChivite
Esri Frequent Contributor

Hi. If you were to publish your districts as a feature layer, you could have Integromat do a point in polygon query to get the district and then push the attribute into your survey record. That way, by the time Integromat runs the report module your record is ready.

To perform the query and the update you can use the HTTP module in Integromat. I posted some info about how to do this in here: https://community.esri.com/t5/arcgis-quickcapture-blog/data-enrichment-with-arcgis-quickcapture-and-...  The article is about QuickCapture, but the logic applies to Survey123 the same way. You can also find animations and step by step instructions here: https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-integromat/ba-p/89...

View solution in original post

0 Kudos
5 Replies
IsmaelChivite
Esri Frequent Contributor

Hi. If you were to publish your districts as a feature layer, you could have Integromat do a point in polygon query to get the district and then push the attribute into your survey record. That way, by the time Integromat runs the report module your record is ready.

To perform the query and the update you can use the HTTP module in Integromat. I posted some info about how to do this in here: https://community.esri.com/t5/arcgis-quickcapture-blog/data-enrichment-with-arcgis-quickcapture-and-...  The article is about QuickCapture, but the logic applies to Survey123 the same way. You can also find animations and step by step instructions here: https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-integromat/ba-p/89...

View solution in original post

0 Kudos
ShelbyZelonisRoberson
Occasional Contributor II

@IsmaelChivitethank you! I spent some time putting this all together using your suggestion and I think I am SO CLOSE but I keep getting an error in my 2nd HTML request (after the Parse JSON module). 

I've attached a screenshot of my Parse JSON module (results look great - I am looking for the DIST field to equal 1 for this test point), my 2nd HTTP request inputs, and the results of the 2nd HTTP request with the "unable to complete operation" error message. I read through your blogs and watched the video many many times and I really thought I had it all correct, so I'm not sure why I am getting this error. If you have any ideas that would be wonderful.

0 Kudos
IsmaelChivite
Esri Frequent Contributor

I cannot see the images because I get a Virus scan in progress message that never goes away. Lets connect quickly through a screen-sharing session. Send an email to ichivite@esri.com so I can respond with an invite.

0 Kudos
ShelbyZelonisRoberson
Occasional Contributor II

Hmm that's annoying about the images. I sent you an email, thank you 🙂 

0 Kudos
ShelbyZelonisRoberson
Occasional Contributor II

UPDATE: I had a slight issue with my JSON... make sure you have square brackets around the whole thing! 

This is what worked: 

[
{
"attributes":{
"OBJECTID": {{1.feature.result.objectId}},
"district": {{18.features[].attributes.DIST}}
}
}
]

0 Kudos