Creating an email alert for Medallia API errors

Configure a basic record-triggered flow to alert designated administrators in your Salesforce org when specific Medallia API errors occur while processing invitations through the queue.

To set up the record-triggered flow:

  1. On Setup, use quick search to find the Flows option.

  2. Click Flows.

    Screen capture of Setup screen with the highlighted "Flow" process automation option

  3. Click New Flow.

    Screen capture showing the new flow option

  4. Select the option Record-Triggered Flow, then click Create.

    Screen capture showing the flow creation form with highlighted record-triggered flow option

  5. Set the flow conditions as follows:

    Screen capture showing record-triggered flow conditions form

    1. Object — medallia_xm__Log__c (Log)

    2. Trigger the Flow When — A record is created

    3. Set entry conditions as follows:

      1. Condition Requirements — Custom Condition Logic is Met

      2. Condition Logic — (1 OR 2 OR 3) AND 4

      3. Condition 1:

        1. Field — medallia_xm__message__c

        2. Operator — Contains

        3. Value — StatusCode=503

      4. Condition 2:

        1. Field — medallia_xm__message_c

        2. Operator — Contains

        3. Value — Service Unavailable

      5. Condition 3:

        1. Field — medallia_xm__StackTrace__c

        2. Operator — Contains

        3. Value — Message Read timed out Stack Trace Class.medallia

      6. Condition 4:

        1. Field — medallia_xm__Level__c

        2. Operator — Equals

        3. Value — ERROR

  6. Click Add Element.

    Screen capture showing record-triggered flow diagram with highlighted add element option

  7. Select Assignment.

    Screen capture showing the element dropdown list with the selected Assignment option

  8. Enter a label and assign the API name.

    Screen capture showing new assignment form with label and API name

  9. Set the variable value by clicking Variable, and selecting New Resource.

    Screen capture showing the variable dropdown list with the highlighted new resource option

  10. Select Variable.

    Screen capture showing resource type dropdown list with highlighted variable option

  11. Set the variable details as follows and click Done.

    1. API Name — Error_Message.

    2. Data Type — Variable.

  12. Set the value to Record — Message.

    Screen capture showing Value dropdown list with highlighted Record option

    Screen capture showing Value dropdown list

    Screen capture showing variable values

    Record triggered flow diagram

  13. Click Add Element.

  14. Select Action.

    Screen capture showing add element dropdown list with highlighted action

  15. Select Email as the Category, then click Action and select Send Email.

    Screen capture showing action dropdown list with highlighted Send Email action

  16. Enter in the details for the send email action:

    1. Label — Send Medallia API Error Email

    2. Body — Tic Include and select Error_Message variable on the dropdown list.

      Screen capture of the body dropdown list with highlighted Error_Message variable

    3. Recipient Address List — Tic Include and enter the email addresses for the designated recipients of the alert email.

      Screen capture of recipient address list text box with example email address

    4. Subject — Tic Include and enter in the email subject.

      Screen capture of Subject text box

    5. Click Done.

  17. On the top bar, click Save.

    Screen capture of top bar with highlighted save option

  18. Enter a descriptive flow label and assign the API name.

    Screen capture showing Flow Label and Flow API name options

  19. On the top bar, click Activate.

    Screen capture of top bar with highlighted activate option

    Screen capture of successful flow-activation message

When a timeout error occurs and is logged, your designated administrators receive an email alert from Salesforce while this flow is active.