Loading Audio...

Listen to Lesson
0:00
  • Speed 0.5x
  • Speed 0.75x
  • Speed 1x
  • Speed 1.25x
  • Speed 1.5x
  • Speed 2x
  • Brian
  • Caris

Creating a Dashboard for Contact Us Responses

As Clarity continues to receive contact requests, its team needs a reliable way to track and respond to submissions. To support this, Clarity wants to define a workflow for the Contact Us object and create dashboard for viewing unanswered requests from site visitors. In this article, you’ll implement both of these elements.

Exercise: Creating a Workflow

To improve visibility for pending requests, Clarity needs a workflow that notifies Distributor Representatives of new submissions. Here you’ll create a simple workflow that sends a notification to the Distributor Representatives role for new requests as the Clarity Admin user.

  1. In your Liferay instance, sign in as the Clarity Admin user.

    • Username: admin@clarityvisionsolutions.com
    • Password: learn
  2. Open the Global Menu (Global Menu) and click Process Builder in the Applications tab.

  3. Click New to create a new workflow.

  4. For name, enter Contact Us Follow Up.

  5. In the Nodes panel, find the Task node and drag it into the workflow editor.

    Find the Task node and drag it into the workflow editor.
  6. In the side panel, configure these settings for the Task node.

    Field Value
    Label Follow Up
    Node Name followUp
    Description Ask Distributor Representative to verify new Contact Us submission.
  7. Hover your mouse over the Start node and drag an arrow to the Task node.

    Hover your mouse over the Start node and drag an arrow to the Task node.
  8. In the side panel, configure these settings for the Transition Label.

    Field Value
    Label Review
    Transition Name review_contact_us_entry
    Default Yes
  9. In the same way, drag an arrow from the Task node to the End node.

    Drag an arrow from the Follow Up node to the End node.


    This defines the progression of the workflow.

  10. In the side panel, configure these settings for the second Transition Label.

    Field Value
    Label Approve
    Transition Name approve_contact_us_entry
    Default Yes

    In the side panel, configure these settings for the second transition.
  11. Click the Follow Up node to begin configuring it.

  12. Under Assignments, click Asset Creator.

  13. For Assignment Type, select Role.

  14. For Role, select Distributor Representative.

    For Role, select Distributor Representative.
  15. Click Back (Back) to continue editing the Follow Up node.

  16. Under Notifications, click New

  17. For Name, enter Follow Up Task.

  18. For Template, enter this text:

    There is a new ${entryType} request for you to follow up with.
  19. For Notification Types, select User Notification.

  20. For Recipient Type, select Role.

  21. For Role Name, select Distributor Representative.

    Edit the Follow Up Task.
  22. Click the End node to begin configuring it.

  23. Under Actions, click New.

  24. Set the following attributes for the new action:

    Field Value
    Name Approved Entry
    Type Updated Status
    Status Approved
    Execution Type On Entry
  25. Click Publish.

    Publish the workflow.

Clarity now has a workflow that routes entries to users with the Distributor Representatives role. Next, you'll use it with the Contact Us object.

Exercise: Attaching the Workflow to the Object

Once you create a workflow, you can configure Liferay applications to use it. Here you'll configure the Contact Us object to use the new workflow as the Clarity Admin user.

  1. Open the Global Menu (Global Menu) and go to the Clarity Public Enterprise Website.

  2. Open the Site Menu (Site Menu), expand Configuration, and select Workflow.

  3. Click Edit for the Contact Us asset type.

  4. Select the Contact Us Follow Up workflow and click Save.

    Select the Contact Us Follow Up workflow.

Great! You’ve successfully configured the Contact Us object to use the workflow. This ensures that users with the Distributor Representatives role receive notifications for new submissions, so they can review and address reach one. Next, you’ll create a UI for displaying pending tasks.

Exercise: Creating the Contact Us Responses Data Set

To help representatives monitor incoming requests, Clarity needs a way to display pending contact submissions in a clear, structured UI. Here you’ll enable Liferay Data Sets and use it to implement this UI as the Clarity Admin user.

  1. Open the Global Menu (Global Menu), go to the Control Panel tab, and click Instance Settings.

  2. Under the Platform section, click Feature Flags.

  3. In the Release tab, enable these features:

    • Root Object Definitions (LPD-34594)
    • Data Set Manager (LPS-164563)

    In the Release tab, enable these features.

    Now you can create a data set.

  4. Open the Global Menu (image-20250530-132654.png), go to the Control Panel tab, and click Data Sets.

  5. Click Add to create a new data set and enter these details:

    Field Value
    Name Contact Us Responses
    REST Application /c/contactuses
    REST Schema ContactUs
    REST Endpoint /scopes/{scopeKey}

    Click Add to create a new data set and enter these details.
  6. Click Save.

  7. Click the Contact Us Responses data set to begin editing it.

  8. Add this parameter to the Parameters input box:

    filter=(status/any(x:(x eq 1)))
    NOTE
    This filter checks whether any status value equals 1, which corresponds to entries in a pending status.
  9. Click Save.

  10. Go to the Visualization Modes tab.
    Here you can determine what data users can view for different visualizations (i.e., table, list, or cards).

  11. Go to the List tab.

  12. Click Add (Add) for the Title row and select Assign from Data Source.

    Select Assign from Data Source for the Title row.
  13. Select the fullName field.

    Select the fullName field.
  14. Click Save.

  15. Click Add (icon-plus.png) for the Description row and select Assign from Data Source.

  16. Select the comment field.

  17. Click Save.

    Select the comment field for the Description row.

Now when users view the data set as a list, these data points appear. The list should also only include entries with a ‘Pending’ workflow status. Next, you’ll display the data set on a site page.

Exercise: Displaying the Data Set on a Page

Clarity wants to display their new data set on a dedicated page. Here you’ll create the Contact Us Responses page and add the data set to it as the Clarity Admin user.

  1. Go to the Clarity Public Enterprise Website.

  2. Open the Site Menu (image-20250530-131206.png), expand Site Builder, and select Pages.

  3. Click New to create a new page.

  4. Select the Primary Master Page template and name it Contact Us Responses.

  5. Click Add.

  6. Drag and drop the Data Set fragment into the page’s drop zone. 

  7. In the General panel, click Add (icon-plus.png) to select a data set.

  8. Select the Contact Us Responses data set and click Save.

    Select the Contact Us Responses data set and click Save.
  9. Click Publish.
    Since no tickets have been submitted after setting up the workflow, there are currently no pending entries to display.

  10. Verify everything works as expected:

    • Use the Contact Us form to submit a few sample entries.
    • Then return to the Contact Us Responses page to see the pending requests appear in the data set.
    • Next, sign in as (or impersonate) Daniel Raymond to confirm that the Distributor Representative received the workflow notifications.
    • Finally, assign the ticket to Daniel Raymond, approve it, and return to the data set page to confirm the entry has been removed.

Great! The data set is now published on a page, allowing users to view pending Contact Us entries in real time.

Conclusion

Congratulations! You’ve completed Module 6: Content Authoring and Management. Throughout this module, you’ve learned best practices for creating, storing, organizing, and displaying content in Liferay DXP. You also learned about setting up publishing workflows for facilitating and streamlining content collaboration.

In the next module, you’ll learn about using Liferay analytics and personalization features to create and improve user experiences.

Loading Knowledge