0

I need the clarification for the below one. Here I tried to create a "Record Triggered flow" for the below scenario with Case and email message objects. But its does not triggering properly and am getting the error on debug. Anyone please check and help me to get the output for this below scenario flow.

Scenario:

The scenario was, If the "Status" is equals to New and incoming equals True, and To address equals to Test@gmail.com in email message object and Brand name, owner ID's are does not equal to specific values in case object means, that case should moves to expected queue. I mean that case owner ID should update the expected queue name.

So I setup the condition in flow by using Get, Update and decision elements based on the requirements. But its does not works.

Condition : (Object : email message)

Incoming = True

Status = New

To address = Test@gmail.com

Condition : (Object : Case)

Brand does not equal to Nestle

Owner ID does not equal to Testing_Queue

Need to Update values : ( Object : Case)

Owner ID : Sample queue.

I created the "Record Triggered flow" with entry conditions and related with ID's between email message and Case objects. But its does not works and shows the error on debug. Please anyone review and help me to complete this flow.

enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here

4
  • OwnerId is an ID field and you are comparing against a string. You want to compare Owner.Name to a string.
    – cropredy
    Jun 20 at 20:47
  • @cropredy - Sorry, I can't understand this step, How to compare owner.name to a string in this above flow. please explain.
    – ajmal khan
    Jun 21 at 9:49
  • You'll need to query for the Group with Name =Testing_Queue to get the Id,then use the ID in the filter
    – cropredy
    Jun 21 at 12:24
  • @Cropedy - Thank you so much, Now the owner ID has updated . But now I have facing the error with filter records. The actual scenario was if the Brand does not equal to "Nestle" and the existing Owner ID does not equal to Testing_Queue means only (Ref- Screenshot 3-get records) ,Owner id should update as "Sample queue". But in my flow , It will update the Owner id as "sample queue" for all the records even if the brand = nestle. Flow not filtering the records as per the conditions. Please advise.
    – ajmal khan
    Jun 21 at 18:46

1 Answer 1

0

You can rework this flow to be simpler and clearer

  1. Get Records from Case - This can be eliminated because $Record.Case.xx provides access to the EmailMessage's parent Case.
  2. Get QueueName - rename this to Get Ineligible Owner as that is what it is doing.
  3. Decide the condition - this label tells the developer nothing. Rename it to something like Is Case Eligible for Reassignment?. This decision block checks these items (AND) to be true:
    • $Record.Case.Id isNull False
    • $Record.Case.OwnerId notEqual resultfromGetIneligibleOwner.Id
    • $Record.Case.Brand__c noEqual Nestle
  4. TRUE branch then
    • does a Get Records to find Group:Sample Queue
    • does an Update Records using
      • ID <- $Record.Case.Id
      • OwnerId <- result from the Get Records of Group: Sample Queue`
  5. FALSE branch goes to END

The key to success with flows is to use good naming conventions and to recognize that in most cases, you can avoid querying for related records if they are lookups of the flow's target object.

4
  • I tried as you mentioned above, But I get the Error on debug and its not get filtering the records properly. For your reference, Please find the Screenshot attached on above.
    – ajmal khan
    Jun 22 at 13:19
  • it should be Id = $Record.ParentId in the Update (Case) Record element. You were trying to find Case's by querying on a case's ParentId
    – cropredy
    Jun 22 at 21:24
  • @Cropedy - Even I tried with Id = $Record.ParentId in Update (case) record too as you mentioned. The Expected queue (sample queue) was updated in Owner ID field. But still the filter not working and the owner id has updating for all the records. Its not filtering the records as per the decision element conditions.
    – ajmal khan
    Jun 23 at 17:46
  • Examine the debug log to gain better insight
    – cropredy
    Jun 23 at 18:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.