Cracking into the geoprocessing abilities in QuestionWhere

QuestionWhere is an Esri UK application that allows you to easily build a questionnaire or survey. By leveraging the platform, the survey can go beyond recording peoples answers and trigger steps in businesses workflows and processes. If you’re new to QuestionWhere visit this blog to find out how to get started creating your surveys. In this blog I want to highlight the functionality that QuestionWhere has to offer and to show how you can benefit from making use of them in your surveys.

In this example I will be designing a survey which allows users to suggest the location for an Automated External Defibrillator (AED), portable electric devices that diagnose cardiac arrests and treat with defibrillation. AEDs are positioned in public areas across the country to provide access to anyone who may need one in an emergency. The UK Resuscitation Council guidance have said when needed, an AED should be within 5 minutes of a patient. This translates to roughly 400m at an average walking pace. Can we incorporate the guidelines in a public survey?

To do this the survey will need to include the following Actions:

  • Execute a geoprocessing task
  • Send an email
  • Append to an existing feature service
  • Write to a new feature service

To ensure there isn’t an over-placement of AEDs in one area, the location that is requested needs to be geoprocessed to determine whether an AED already exists within the required distance (~400m). When the user enters their location they will then be told whether or not their suggestion qualifies based on the output of the geoprocessing task (GP task). The output produced by the task will then be emailed to the email address entered by the user and to an email alias to notify myself, the survey owner, of a submission. The location will be added to a feature service where the owner can review and keep or delete, where appropriate.

This survey requires three basic inputs from the user:

  1. Suggested location of AED
  2. Name
  3. Email address

The QuestionWhere survey uses this information and the actions listed above to do the following:

  1. Analyse if there are any existing AEDs within 400 m of this suggested location
  2. Provide the user with an immediate response as to whether this is a suitable suggestion
  3. Emails the user with the above information along with a unique ID for the request for any follow up enquiries
  4. Emails the provider of the QuestionWhere survey to notify them of a suggestion and provide all of the submitted information, along with the results of the GP task
  5. Adds the suggested location to a new feature service; suggested AED.

How did I produce the QuestionWhere survey? 

Setting up the Geoprocessing Task

The GP task needs to calculate the distance from the point the person who took the survey inputted, to each of the existing AED locations. It then needs to identify if any of these distances are below 400m and then communicate an appropriate message to the user to say whether there are any AEDs that fall within 400m of the suggested point and if so draw out the distance as well as the XY location of the AED.

To do this I used tools from ArcGIS for Desktop and some ArcPy scripting. The Generate Near Table tool produced a table with the XY’s and distances of all the AED’s which fell within 400 m of the placed location. This table is then interrogated by an ArcPy script to see whether the table has produced any results and executes a message accordingly:

If there is an AED within 400m of suggested location the response will be:

“There is already an AED located" + OUTPUT DISTANCE + "ms from this location. Due to recommended AED placement guidelines this proximity is seen as close enough. However, we will review the suggestion and get back to you."

If there isn’t an AED located within 400m of suggested location then the following will display: “Your request has been submitted”.

Once the Task was up and running I took the following steps to get it to be available to QuestionWhere:

  1. Publish geoprocessing service to ArcGIS Server
  2. Add the REST endpoint of the geoprocessing service to ArcGIS Online
  3. Make geoprocessing service publically available in ArcGIS Online

Creating an Action for executing a geoprocessing task

Search for the GP task from My Organisation:

Once the GP task is selected you will be prompted to fill in any necessary parameters that will be entered in the QuestionWhere survey. In this case we have to match the suggested point by the User to the parameter in the Task that will be measured against the existing AEDs.

There is no limit to the number of GP Task executions that are carried out in one survey. The potential of the GP tasks action can be taken much further as you can bring in the python library. Furthermore, tasks can be integrated to your organisation’s corporate business systems.

Sending an email

I then added another Action but this time selected the “Send an email” option. In this scenario we are looking at how we can leverage both an internal and external workflow. We will, therefore, be sending an internal email to the person responsible for reviewing suggestions and an external email to the person who submitted the suggestion.

1.      An email is sent to a specific address e.g. an alias or your email address

This allows the person responsible for the survey/the data collected to be notified when a new submissions is made.

2.      To send an email to the person who took the survey, I’ve selected the email question in the action. This ensures that upon completion of the survey a predetermined email is sent to that address.

This allows me to give the user a reference number for their suggestion, for any follow up questions they may have. Alternatively, this email action could be used to provide some results of a geoprocessing task, a timeframe on their submission, a contact name, number and email for them to reach in future.

The Send an Email action will send an email from QuestionWhere@esriuk.com. If you want to use your own email address you can use GP tasks which can send emails from your organisation's domain.

Writing to a feature service

There are two ways of collecting the suggested locations of these potential AEDs. One workflow is to write the points to the existing AED layer to then be removed or kept where appropriate. The other is to write to a brand new feature service containing only the suggested locations of AEDs until they are reviewed and added to the existing layer if deemed appropriate. The latter is the one I have chosen to put in place in this survey. One of the impressive things, in my opinion, about QuestionWhere is that instead of having to worry about creating a blank feature service in ArcGIS for Desktop or through Developers for ArcGIS, a new feature class can be created here in the Action itself.

In both cases the feature service that is being written to can be private - enabling you to collect datasets that can only be accessed by you or your organisation whilst being contributed to by members of the public.

Completion Text

The Completion Text section of the QuestionWhere builder is the text I want the user to be presented with upon completion of the survey along with any appropriate output from the GP task. Here I am thanking the user for making their request alongside the response from the GP task describe above.

Pic5.png

Overall, this example of a QuestionWhere survey has shown how a simple suggestion for a location of an AED in our area has triggered multiple actions. A GP task tells the user if their suggestion is valid, the suggestion is written to a brand new feature service without any prior creation necessary and both the user and myself receive an email of such suggestions. I can now sit back, let the survey do all the work and wait for these emails to roll in.