function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Prasanth RPrasanth R 

Flows mutiple id

I want to create the new custom field in the case object,In the custom field i need to add multiple email id.whenever the case is closed it should the email notification to the email id

kindly some one help me how to execute this scenario by using flow

i tried :
i used large text area to create the field.i'm using the flow to execute this task

i created new record trigger flow in after update.

User-added image

User-added image

User-added image

User-added image
User-added image

Darshit Pathak 10Darshit Pathak 10

if possible Please make use of before Save flows (Fast Field Updates), to avoid recursion on Case.
as here we are updating the same record which has triggered the flow.
Once the flow is created , click on + icon shown below the start element and click on "Update triggering Record".
Type Field Name there in Field box, and provide values. i.e. comma seperated emaild Ids. like abcd@xyz.com,efg@hijk.com,pqrs@jklm.com
Even if you are continue using After Save flow only, then update the field with such comma seperated values.

So by doing this your task of populating multiple email Ids in a single field is accomplished.

Now Sending email part, so as we need some logic to perform to determine the to addresses, email logic should be written in trigger code.

Write an afterUpdate trigger on Case, whenver Case status is changed to Closed, invoke email sending method.

in that method get all the email Ids as a String and use "split(',') to convert it to a list of string.

let say cs is your Case record and email__c is the custom long text area field that holds all email Ids.
List<String> allEmailList = cs.email__c.split(',');
now use this allEmailList to set the toAddress while creating instance of Messaging.singleEmailMessage.
For more information on how to send email through apex check this URL:

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_forcecom_email_outbound.htm
https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_email_outbound_single.htm

Mark this as best answer if it helps!!

Prasanth RPrasanth R

i tried this scenario by using flow..i want to add the case thread id in n the templates.when i search the field the i can't find field the field to add..how to include the field in the templates kindly someone help me.

User-added image

User-added image

User-added image