Configure Mosquito Service Requests

In this topic, you will learn how to configure the Mosquito Service Requests solution to meet specific needs in your organization.

Configure the Mosquito Control site

The Mosquito Service Requests solution includes the Mosquito Control ArcGIS Hub site that your organization can configure with your own branding and share important mosquito control information and abatement activities with the public.

Update with organizational information

After deploying the Mosquito Service Requests solution, the Mosquito Controll site layout only requires a few updates to fit your organizations context. Consider what information you already have and what you can most easily find. This information can include the following:

  1. Sign in to your ArcGIS organization and browse to the Mosquito Control site.
  2. Open the item page, click Configure App.
  3. Click the edit button edit to open the site editor.
  4. Scroll to the statistics section listed under the website title. The Requests Completed card is already linked to the Mosquito Service Requests solution’s MosquitoObservations feature layer. These stats will automatically update as service requests are completed.

    The Vector-borne Disease Cases statistic is provided in a text card but styled to resemble the summary statistics card; this allows you the option to manually enter a statistic of your choice, independent of the solution data. Update the Vector-borne Disease Cases stat card using a metric of your choice or replace the text card with a summary statistics card and configure it to another feature layer in this solution or a related solution (see below).

    To replace the text card with a summary statistics card, click Layout in the side panel. Drag a Summary Statistics card, from the side panel onto the row and position the card to the right of the Surveillance Sites card. Once the card is configured, hover over the existing Vector-borne Disease Cases card and click the delete button delete.

  5. Scroll to the Report a Problem section, hover over the card and click the setting button settings, and update your call center and contact information, hours and phone number.
    Note:

    The Submit a Request link is already configured to open the Mosquito Service Request app.

  6. Scroll to the Frequently Asked Questions section, hover over the card and click the setting button settings, and update the questions and answers.
  7. Scroll to the Mosquito Open Data section, hovering over the open data card and click the settings button settings, and update the various category links using tags, categories, or groups that references your ArcGIS Open Data in the side panel.
  8. Modify your site’s Footer, on the side panel, click Customize Toggle customize toggle.
  9. Click Footer. A custom footer is already provided, and in most cases needs to be updated with just your Organizations branding, contact information and social media references.
  10. Click the HTML text box.

    HTML window opens.

  11. Make the necessary changes and click Apply.
  12. Click Save.

Deploy related solutions

This site references content from the Mosquito Surveillance, Mosquito Treatments, and Adopt-A-Catch Basin solutions. To deploy these solutions, click the link below and follow the steps under Deploy Now for each solution:

Update solution references

This site has references to solutions deployed in the previous section. To update your site, complete the following steps:

  1. If necessary, sign in to your ArcGIS organization and browse to the Mosquito Control site.
  2. Open the item page, click Configure App.
  3. Click the edit button edit to open the site editor.
  4. Scroll to the Surveillance Sites section under the website title, hover over the card and click the setting button settings.
  5. In the side panel, click Find an Item and search for the MosquitoSurveillance_public feature layer.
  6. In the search results, click on the circle in the top left corner next to MosquitoSurveillance_public.
  7. In the side panel, click the Surveillance Sites (Point) layer. This feature layer was deployed in the previous step (part of the Mosquito Surveillance solution).
  8. Click Select.
  9. In the side panel, do the following:
    1. For Statistic Field, click Location.
    2. Leave Statistic Type as Count.
    3. Expand the Filter by Attributes section, click the drop-down arrow and choose Status as the attribute.
    4. Click Add.
    5. Click the Status drop-down and choose Active.
  10. Scroll to the Surveillance section, hover over the Surveillance Results card and click the setting button settings.
  11. Click the Learn More button and click Edit.
  12. Enter the Mosquito Population Surveillance Charts app URL into the Link Destination text box and click Add Link.
  13. Under the Health Concerns, hover over the card and click the setting button settings.
  14. Click the Learn More button and click Edit.
  15. Enter the Mosquito Health Concerns Summary app URL into the Link Destination text box and click Add Link.
  16. Scroll to the Treatments section, under Treatment Areas, hover over the card and click the setting button settings.
  17. Click the Learn More button and click Edit.
  18. Enter the Mosquito Spray Areas app URL into the Link Destination text box and click Add Link.
  19. Under Exclusion Requests, hover over the card and click the setting button settings.
  20. Click the Learn More button and click Edit.
  21. Enter the Mosquito Spray Exclusion app URL into the Link Destination text box and click Add Link.
  22. Scroll to the How you can help section.

    The Take the Pledge is provided as a placeholder for your organization to add your own Survey123 form or organization resource. Update the Pledge Now button URL or remove this section if not applicable. To update the button, hove over the card and click the setting button settings. Click on the Pledge Now button and click Edit. Enter the Survey123 form or organization resource URL into the Link Destination text box and click Add Link. Or remove the Pledge Now button by clicking the setting button settings, select the button text and press the Backspace key.

  23. Under Adopt-A-Catch Basin, hover over the Adopta a Catch Basin card and click the setting button settings.
  24. Click the Learn More button and click Edit.
  25. Enter theAdopt-A-Catch Basin app URL into the Link Destination text box and click Add Link.
  26. Click Save.

Execute Mosquito Service Requests tools

You can extend the Mosquito Service Requests solution with a set of Python tools that can be used to generate report IDs, moderate reports, send email notifications, and enrich reports. These tools can be executed automatically via Task Scheduler and as new problem reports are submitted, or updated, the corresponding action will occur.

Add the ServiceFunctions toolbox

The ServiceFunctions toolbox contains tools for generating report IDs, moderating reports, sending email notifications, and enriching reports. Download and add the ServiceFunctions toolbox to your ArcGIS Pro project before configuring the appropriate tools.

  1. Download the ServiceFunctions toolbox.
  2. Browse to the ServiceSupport.zip file and unzip the file to the desired location from which you want to the tools to execute.
  3. Open ArcGIS Pro and create a new project.
  4. If necessary, sign-in to the ArcGIS organization to which you deployed the Mosquito Service Requests solution.
  5. If necessary, on the View tab, in the Windows group, click the Catalog pane.
  6. In the Catalog pane, right-click Toolboxes and choose Add Toolbox.

    The Add Toolbox dialog box appears.

  7. Browse to the ServiceReport folder and double-click the folder twice.
  8. Click the ServiceSupport.pyt Python toolbox, and then click OK.
  9. In the Catalog pane, expand Toolboxes and ServiceSupport.pyt.

    If you've never used the ServiceSupport toolbox before, run the Define Connection Settings tool to establish a connection between the toolbox and the MosquitoObservations feature layer.

  10. In the Catalog pane, in the ServiceSupport.pyt Python toolbox, double-click the Define Connection Settings tool.
  11. In the ArcGIS Online organization or ArcGIS Enterprise portal URL parameter, click the drop- down arrow and choose a URL.
  12. In the Username parameter, type your user name for the organization you chose in step 11.
  13. In the Password parameter, type your password for the user name provided in the Username

    parameter.

  14. Click Run.

Generate report IDs

Many workflows require that a unique identifier be generated when a feature or record is created so it can be referenced and tracked in other workflows. The Generate IDs tool can be used to configure custom unique identifiers that will be applied to features at a regularly scheduled interval of your choosing. The tool only generates the configuration; an additional script (provided) must be run to update the features with incrementing identifier values.

Note:

You may need to add a new field to the MosquitoObervations feature layer to store the unique identifier created in this workflow.

  1. If necessary, in the Catalog pane, expand Toolboxes and ServiceSupport.pyt.
  2. Double-click the Generate ID’s tool.
  3. In the Layer parameter, click Browse.

    The Layer dialog box appears.

  4. Under Portal, click My Content.
  5. Double-click the Mosquito Service Requests folder.
  6. Double-click the MosquitoObservations feature layer.
  7. Click Mosquito Observations, and then click OK.

    Expand General Identifier Settings. If the tool has not been run previously, start by specifying at least one identifier sequence.

  8. In the Sequence Name parameter, type a name for the sequence. This value will appear in the drop-down menu for selecting the sequence to assign to each layer.
  9. In the Pattern parameter, type a pattern to use for the sequence.

    This can be a combination of letters, number, and symbols. Mark the location for the incrementing value with a pair of curly braces {}. Python formatting will be applied to the pattern text, so string formatting syntax such as {0:03d} will pad the incrementing number section with zeros to a length of 3. For example, the pattern seq-{0:05d} would result in identifier values such as 'seq-0001', 'seq-002', 'seq-0010', and so on.

  10. In the Next Value parameter, type a value.

    When initially creating the sequence, this should be the first value want to use in the identifiers. After this point, this value will show the value to be used for the next identifier generated.

  11. In the Interval parameter, type a value.

    The interval by which the identifier values should increase between features. For example, an initial Next Value of 1 and an Interval of 10 would create identifiers with the incrementing values of 1, 11, 21, and so on.

    Keep in mind that deleting or changing these sequences will impact all the layers that are configured to use the edited sequences.

  12. If an identifier configuration already exists, a check box will appear that, when checked, will delete the existing identifier configuration for the selected layer. Alternatively, edit the identifier configuration and run the tool to overwrite the existing identifier configuration for the selected layer.
  13. Choose the sequence to use to generate the identifiers for each feature in the layer.
  14. Choose a text field to store the generated identifier.
  15. Click Run to write out the identifier configuration for the layer and any changes to the identifier sequences.
  16. To configure identifiers for another layer, rerun the tool with the settings for the next layer.
  17. Keep in mind that the General Identifier Settings are not specific to any one layer—they apply to all layers configured using this tool.

Moderate reports

Public comment apps can occasionally generate feedback that should not be made publicly visible. Data entered into specific fields, such as personal information, can be hidden and protected using the pop-up configuration and layer security, but sometimes entire comments need to be hidden to avoid displaying sensitive or explicit content to other users.

Features can be hidden by updating the value of a field so that it no longer meets the requirements of a filter applied to that layer in the map. The Moderate Reports tool can be used to configure which layers and fields to scan for explicit or sensitive words and phrases, and how to update the feature so that it can be filtered from the map. Features and records can be scanned with a frequency of your choosing. The tool only generates the configuration; an additional script (provided) must be run to scan the features.

  1. In the Catalog pane, expand Toolboxes and ServiceSupport.pyt.
  2. Double-click the Moderate Reports tool.
  3. In the Layer parameter, click Browse.

    The Layer dialog box appears.

  4. Under Portal, click My Content.
  5. Double-click the Mosquito Service Requests folder.
  6. Double-click the MosquitoObservations feature layer.
  7. Click Mosquito Observations, and then click OK.

    Expand General Moderation Settings. If the tool has not been run previously, start by specifying at least one moderation list.

  8. In the List Name parameter, type a name. This value will appear in the drop-down menu for selecting the moderation list use when scanning each layer.
  9. In the Filter Type parameter, click the drop-down arrow and choose to scan feature for words and phrases that exactly match the provided list of words and phrases.

    For example, when the filter type is EXACT, if the list contains the word 'duck', the script will update the specified field when the feature contains the word 'duck', but not when it contains the word 'duckling'. When the filter type is FUZZY, the script will update the feature when either 'duck' or 'duckling' are found.

  10. In the Words and Phrases parameter, type in a word or phrase. Provide a comma-separated list of words or phrases to scan for.

    Keep in mind that deleting or changing these lists will impact all the layers that are configured to use the edited sequences.

  11. If a moderation configuration already exists for the selected layer, choose to either edit an existing configuration by selecting the name of the moderation list used in the configuration, or choose the option to add a new moderation configuration.

    If you choose to edit an existing configuration, a check box will appear that, when checked, will delete the existing moderation configuration for the selected layer. Alternatively, edit the moderation configuration and run the tool to overwrite the existing moderation configuration for the selected layer and moderation list.

    To add a new moderation configuration, click the Add New button and continue with the following steps.

  12. Choose the moderation list to use to process the features in the selected layer.
  13. Choose the fields that will be scanned for content that matches the words and phrases in the selected moderation list.
  14. Optionally, provide a SQL query to only apply moderation to some features. If no query is provided, all features are processed.
  15. Choose a Field to Update when a match is found between the value of a field and the content of a moderation list. Use the Found Value parameter to specify the value that should be written to this field indicating a match.
  16. Click Run.

Send email notifications

Many workflows require that an email be sent when a feature or record is created and updated. The Send Emails tool can be used to configure emails that can be sent based on attribute values and a schedule of your choosing. The tool only generates the configuration; an additional script (provided) must be run to actually generate and send the emails.

  1. In the Catalog pane, expand Toolboxes and ServiceSupport.pyt.
  2. Double-click the Send Emails tool.
  3. In the Layer parameter, click Browse.

    The Layer dialog box appears.

  4. Under Portal, click My Content.
  5. Double-click the Mosquito Service Requests folder.
  6. Double-click the MosquitoObservations feature layer.
  7. Click Mosquito Observations, and then click OK.

    All existing email settings for the layer will load and can be edited by updating the parameter values for each configuration. To delete a single email configuration, click the x next to the configuration. To delete all the email configurations for the layer, check the Delete all existing email configurations for this layer check box. Execute the tool to save your changes.

  8. In the Email Template parameter, click Browse to the ServiceSupport folder.
  9. Click one of the HTML templates for the body of the email, and then click OK.

    To add attributes from the triggering feature to the email, use unique string keys in the places where the values should appear in the HTML and reference these strings in the Find column of the Substitutions section of the General Email Settings along with the name of the field that contains the value to be substituted for the string key in the Replace column.

  10. Optionally, in the SQL Query parameter, provide a SQL query to only trigger an email from specific features.

    If no query is provided, all features will trigger emails every time the script is run, so you most likely want to use this query along with the Field to Update and Sent Value parameters to ensure that the same email isn't sent repeatedly for the same feature.

  11. In the Recipient Email Address parameter, type an email address of the recipient, or the name of a field in the layer that contains the address of the recipient.
  12. In the Email Subject parameter, type the subject for the email.

    Like the email body provided in the HTML document, this text can contain string keys that will be swapped out for attribute values based on the Find and Replace values defined in the Email Substitutions list in the General Email Settings section.

  13. In the Field to Update parameter, type Email. When the email has been sent for each feature. Use the Sent Value parameter to specify the value that should be written to this field indicating that the email has been sent. This field and value can be used in the previously described SQL query to prevent duplicate emails from being sent.
  14. Configure additional emails to be sent for the currently selected layer by clicking the Add New button. Emails will be sent in the order they are configured.

    Expand General Email Settings. If the tool has not been run previously, start by specifying the connection information for your SMTP server in the tool.

  15. In the SMTP Server parameter, type the URL of the SMTP server used for sending emails.
  16. In the SMTP Username parameter, type the user name required to authenticate to the SMTP server. This is not required if authenticating through a port.
  17. In the SMTP Password parameter, type the password required to authenticate to the SMTP server. This is not required if authenticating through a port.
  18. In the From Address parameter, type the address from which the emails should be sent.
  19. In the Reply Address parameter, type the address that should be used for any replies to the email message.
  20. Check or uncheck the Use TLS check box to enable or disable TLS.
  21. In the Email Substitutions section, type Find and Replace values. Swap out one piece of text for another in the outgoing email subject or body. Anywhere a value in the Find column is found in the email subject or body, it will be replaced with the corresponding value from the Replace column. If the value in the Replace column is a field in the layer, the Find value will be replaced with the value in that field in the triggering feature.

    For example, to add the ID of a feature from the REQUESTID field to the email subject, include a piece of text such as {ID} in the configured Email Subject, and add {ID} to the Find column and REQUESTID to the Replace column in this parameter. All specified substitutions are applied to all emails configured for all layers so, while the Find values can be any piece of text, it's suggested that you use something that is clearly variable-like and unlikely to appear elsewhere in the messages in a literal form.

    Keep in mind that deleting or changing these settings will impact all the emails for all the layers configured with this tool.

  22. Click Run.

Enrich reports

Reports made in public comment apps can be enriched with information about the report location. This information can then be used to efficiently direct the report to the correct person or agency responsible for its resolution.

The Enrich Reports tool can be used to configure which attribute values to calculate from a coincident or intersecting set of features at a regularly scheduled interval of your choosing. Note that the tool only generates the configuration; an additional script (provided) must be run to update the features based on intersecting features.

  1. In the Catalog pane, expand Toolboxes and ServiceSupport.pyt.
  2. Double-click the Enrich Reports tool.
  3. In the Layer parameter, click the browse button.

    The Layer dialog box appears.

  4. Under Portal, click My Content.
  5. Double-click the Mosquito Service Requests folder.
  6. Double-click the MosquitoObservations feature layer.
  7. Click Mosquito Observations, and then click OK.
  8. In the Enrichment parameter, if an enrichment configuration already exists for the selected layer, choose to either edit an existing configuration by selecting the configuration from the drop-down list, or choose the option to add a new enrichment configuration.

    If you choose to edit an existing configuration, a check box will appear that, when checked, will delete the existing enrichment configuration for the selected layer. Alternatively, edit the configuration and run the tool to save the changes. To add a new enrichment configuration, click the Add New button and continue with the following steps.

  9. Choose the polygon feature layer that will provide the enriching attribute values by either choosing a layer from the active map, or by browsing to your hosted content and choosing a polygon feature layer.
  10. In the Source Field parameter, click the drop-down arrow and choose a field from the enrichment layer.
  11. In the Target Field parameter, click the drop-down arrow and choose a field from the CitizenProblem feature layer. The script will not process features that already have a value in the target field.
  12. In the Priority parameter, type a value. Specify the priority that should be given to this enrichment configuration relative to the other configurations for the CitizenProblem feature layer. Enrichment configurations for a layer that have a lower priority value will override enrichment configurations with a higher value.

    For example, a layer has two enrichment configurations that use the same target field, but one has a priority value of 1 and the other a priority of 2. If the configuration with priority 1 does not produce a valid value for the field, the field will be populated with the value produced from the configuration with priority 2.

  13. Click Run.

Set up Task Scheduler

Use Windows Task Scheduler to schedule the script to generate report IDs when a feature or record is created, moderate reports when feedback contains inappropriate language, send email notifications when a feature or record is created or updated, or enrich reports. All the tools in this toolbox share a common configuration file and execution script, so only one scheduled task is required to automate running all the associated processes.

  1. Open the Task Scheduler on the computer that is hosting the scripts.
  2. Click Action > Create Task and name your task.
  3. Click the Action tab and click New.
  4. Set Action to Start a Program.
  5. Browse to the location of your Python 3 installation (for example, <default directory>\C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe).
  6. In the Add arguments text box, type the name of the script (servicefunctions.py).
  7. In the Start in text box, type the path to the folder where your script is and click OK.
  8. Click the Trigger tab, click New, and set a schedule for your task.
  9. Click OK.

When the trigger occurs, the scripts will begin scanning the configured layers and, for each one, processing (in order) configurations for generating identifiers, enriching reports, moderating reports, and sending emails.