Create a suggestion box

In this example, you will use the PurgoMalum API to remove profanity and other objectionable content from feature requests and feedback, notify your customer support team of any potentially irate customers, and store approved suggestions in a SharePoint list.

This is a simple example that uses no authentication Identifying the requestor of the API using techniques such as a username and password, an API key, or OAuth2.0., passes parameters A piece of information passed to a third-party API during a request. in the query Part of the URL that does not fit into the path structure, and provides additional information or parameters for the request. The query is prefaced by a question mark (?) in the URL, for example: http://example.com?color=blue., and accepts a simple JSON JavaScript Object Notation: a data format based on JavaScript that is commonly used for API request parameters and responses. object as a response The return from a third-party API after a request has been made by the client.. The n-ntx-summary specification extension A Nintex-specific OpenAPI Specification key that allows special functionality within Nintex Xtensions. and watermarking have been used to provide additional guidance to the workflow designer.

The complete OpenAPI Specification A Nintex-specific OpenAPI Specification key that allows special functionality within Nintex Xtensions. and icon for this example are available here.

The PurgoMalum API

The PurgoMalum API is a free service that checks a given section of text against a list of profane or objectionable words, and replaces any it finds with a fill-word or fill-character to sanitize it. You can specify additional words to censor, and what fill-word or fill-characters to use. The API also provides a simple check on whether profane content is present, which returns a boolean result.

More information can be found at PurgoMalum.com

Create the Open API Specification

Build an OpenAPI Specification that:

Add a second operation to check for profanity that:

  • Uses a get method on the path /checkProfanity with two parameters in the query:
    • Text, which is the text to be sanitized.
    • Add, which is any additional words to sanitize from the text.
  • Responds 200 with a boolean value:
    • True if the text contained profanity.
    • False if it did not.
  • Produces text/plain rather than application/json.

For more information on adding multiple operations, see Define the operations.

 
{
    "swagger": "2.0",
    "info": {
        "version": "1.0",
        "title": "PurgoMalum",
        "description": "The example sanitises text"
    },
    "host": "www.purgomalum.com",
    "basePath": "/service",
    "schemes": [ "https" ],
    "consumes": [ "application/json" ],
    "produces": [ "application/json" ],
    "paths": {
        "/json": {
            "get": {
                "summary": "Sanitize a comment",
                "description": "Remove obscenity from text",
                "operationId": "SanitizeJSON",
                "produces": [ "application/json" ],
                "parameters": [
                    {
                        "name": "text",
                        "description": "The text to be sanitised",
                        "in": "query",
                        "type": "string",
                        "x-ntx-summary": "Text to sanitize"
                    },
                    {
                        "name": "add",
                        "description": "Up to 10 words, or 200 characters",
                        "in": "query",
                        "type": "string",
                        "x-ntx-summary": "Additional blacklisted words"
                    },
                    {
                        "name": "fill_text",
                        "description": "(Max 20 characters)",
                        "in": "query",
                        "type": "string",
                        "x-ntx-summary": "Replacement text"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "properties": {
                                "result": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/containsprofanity": {
            "get": {
                "summary": "Check a comment for profanity",
                "description": "Check for profanity in text",
                "operationId": "CheckProfanity",
                "produces": [ "text/plain" ],
                "parameters": [
                    {
                        "name": "text",
                        "description": "The text to be checked",
                        "in": "query",
                        "type": "string",
                        "x-ntx-summary": "Text to check"
                    },
                    {
                        "name": "add",
                        "description": "Up to 10 words, or 200 characters",
                        "in": "query",
                        "type": "string",
                        "x-ntx-summary": "Additional blacklisted words"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                }
            }
        }
    }
}

Build the workflow

Build a workflow that:

  • Takes customer suggestions by a public web form and checks them for profanity.
  • Notifies customer support of any potentially irate customers for personal follow-up.
  • Sends an email to thank customers who sent non-profane suggestions for their suggestion.
  • Sanitizes profane suggestions, and then sends them to a community manager for approval.
  • Stores approved suggestions in a SharePoint list for future development.

Step 1: Add your Xtension

Import the OpenAPI Specification you created into Nintex Automation Cloud:

  1. Open your Nintex Automation Cloud tenancy.
  2. Click Xtensions in the dashboard to open the Xtensions page.
  3. Click  in the Private connector list.
  4. Click Choose a file. Navigate to the OpenAPI Specification on your computer.
  5. Wait for Nintex Automation Cloud to validate the file.
  6. Click Next.
  1. The Xtension does not use authorization, so click Next.
  1. Edit the Name of the Xtension, which becomes the name of the action group in the Workflow designer.
  2. Edit the Description of the Xtension. This appears in the Private connector list in the Xtensions page.
  3. Select or upload an icon for the Xtension. This is displayed for each action or event in the Workflow designer.
  4. Click Publish.

Step 2: Create the workflow

For more information on creating workflows, see the Workflow Designer.

  1. Click Create workflow in your Nintex Automation Cloud tenancy.
  2. Configure the Start event to be a Nintex form with two text variables:
    • The customer's email.
    • The customer's suggestion.

    For more information on designing forms in Nintex Automation Cloud, see Design a form.

  3. Drag a Check a comment for profanity action after the Start event.
  4. Configure the action to:
    1. Check the suggestion variable.
    2. Store the result in a new boolean variable.
  5. Drag a Branch by condition action after the Check a comment for profanity action.
    For more information, see Branch by condition.
  6. Configure the Branch by condition action to test if the boolean variable equals Yes.
  7. Drag a Sanitize a comment action into the Yes branch.
  8. Configure the Text to sanitize to be the suggestion variable.
  9. Create a variable to store the result.
  10. Drag a Send an email action after the Sanitize a comment action.
    For more information, see Send an email.
  11. Configure the email to notify the customer support staff that a customer may need attention, and add the sanitized suggestion.
  12. Drag another Send an email action into the No branch.
  13. Configure the Send an email action to send an email to the customer thanking them for their suggestion.
  14. Drag an Assign a task action after the Branch by condition has merged.
    For more information, see Assign a task.
  15. Configure the Assign a task action to email the sanitized suggestion in the result variable to a community manager, who will vet their inclusion in the suggestion box.
  16. Drag a SharePoint Online Create an item action on the Accept branch.
    For more information, see SharePoint Online - Create an item.
  17. Configure the Create an item action to store the accepted suggestion in a SharePoint list for suggestions.
  18. Click Test to test the workflow.
  19. Save or publish the workflow.

Tip:  If you want to troubleshoot an Xtension, select Development as the Assigned Use when you publish the workflow. Development workflows display more detailed error messages in their instance details. Republish your workflow as Production when you're ready to use it.