I created a notification when any user got role flow_designer then a notification is sent

AnjiBabu_Ve
Tera Contributor

Whenever the Flow Designer role is assigned to a user, a notification should be sent.

To achieve this, I created:

  • An event on the sys_user_has_role table

  • An after Business Rule on the sys_user_has_role table to queue the event

  • A notification configured on the sys_user_has_role table

However, after the role is removed from the user, the notification email that was previously generated is no longer visible in the Email Logs (sys_email).

 

Could you help identify the reason for this behavior?

3 REPLIES 3

Tanushree Maiti
Tera Patron

Hi @AnjiBabu_Ve 

 

Share your Flow.

 

It is draft architecture. Just check if you have done this way:

 

  1. Define the Trigger
  • Open Flow Designer and create a new Flow.
  • Click Add a trigger and select Record - Created or Updated.
  • Set the Table to sys_user_has_role (User Role).
  • Add a filter condition: [Role] [is] [flow_designer].

 

  1. Create the Notification
  • Navigate to System Notification > Email > Notifications.
  • Click New.
  • Set the Table to sys_user_has_role.
  • Set Send when to Triggered
  • Define the recipients, subject, and body

 

  1. Add the Notification Action
  • In your flow, click Add an Action.
  • Select ServiceNow Core -> Send Notification.
  • Configure the fields using the data picker:
    1. Notification: Select the notification record you created.
    2. Target Record: Drag the User Role Record pill from the data panel into this field.
    3. Recipient: Select the user related to the assigned role.
Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti

Hi @Tanushree Maiti 

I was planning to proceed with the proposed solution from my end, but I wanted to understand the reason behind this behavior. If you have any insights or ideas, could you please let me know?

Do you have any BR to remove Role? 

Any parent child relationship between  sys_user_has_role and sys_email?

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti