0

can anyone help me with the issues in my flow builder in Salesforce? I am trying to connect two cases by matching one case's subject field keywords up with another case's customized field value.

After this matchup, I will let the flow update some fields' values of the two cases respectively.

First, I am getting some records from one case and store in one variable; getting other records from second case and store in another variable;

enter image description here

enter image description here

enter image description here

enter image description here

Then, I am using a formula to connect two cases:

CONTAINS({!caseparkITS.Subject},{!caseparkSystems.New_User_Network_Login_ID__c})

Lastly, I assign values to each field and update the two cases records.

enter image description here

enter image description here

Below are the warnings from the builder when I save my flow:

These issues don't prevent activation, but can cause problems when you run the flow.

GetSubject (Get Records) - The “GetSubject” Get Records element in this flow can cause performance issues. At run time, the flow starts an interview for each record specified in the Start element and stores each case in the $Record global variable. Check whether the “GetSubject” element is still necessary, or add a filter so that the element accesses only the case in the $Record global variable.

GetUserID (Get Records) - The “GetUserID” Get Records element in this flow can cause performance issues. At run time, the flow starts an interview for each record specified in the Start element and stores each case in the $Record global variable. Check whether the “GetUserID” element is still necessary, or add a filter so that the element accesses only the case in the $Record global variable.

update_ITS_status (Update Records) - The “update_ITS_status” Update Records element in this flow can cause performance issues. At run time, the flow starts an interview for each record specified in the Start element and stores each case in the $Record global variable. Check whether the “update_ITS_status” element is still necessary, or add a filter so that the element accesses only the case in the $Record global variable.

Update_Completion (Update Records) - The “Update_Completion” Update Records element in this flow can cause performance issues. At run time, the flow starts an interview for each record specified in the Start element and stores each case in the $Record global variable. Check whether the “Update_Completion” element is still necessary, or add a filter so that the element accesses only the case in the $Record global variable.

2
  • welcome to SFSE. Please see How to Ask on getting the most from the Community. I edited your post to make it more readable. The warnings are telling you that the Get Records and Update Records elements are using query filters that are not using any indexes and hence will most likely require a tablescan of the database.
    – cropredy
    Mar 2, 2021 at 17:11
  • Thank you very much for your help!!! Mar 4, 2021 at 3:22

1 Answer 1

0

Let's look at the first error:

GetSubject (Get Records) - The “GetSubject” Get Records element in this flow can cause performance issues. At run time, the flow starts an interview for each record specified in the Start element and stores each case in the $Record global variable. Check whether the “GetSubject” element is still necessary, or add a filter so that the element accesses only the case in the $Record global variable.

Your Get Records does this query:

SELECT FROM Case
 WHERE New_User_Network_Login_Id__c = null AND
       Status = 'New' AND
       Subject LIKE '%SRQ%' AND
       Subject LIKE '%Directory%'

Case.Status is not indexed; Case.Subject is not indexed and even if New_user_Network_Login_Id__c is indexed (a lookup field), testing for null is likely not to use the index, if any.

Now, if your volume of Cases in your database (now and projected) is small, you can probably ignore the flow warning as the cost of a table scan on a few thousands of rows is probably tolerable, if not ideal.

If I understand your business use case, the flow is triggered on Case 1 and it needs to query for a Case 2 in order to associate the two together. To exploit indices, consider whether the query can use indexable fields - fir example, the CreatedDate. Do you need to consider Case 2's back to the dawn of time? Or just the last 30 (60, ...) days?. Can you exclude some cases based on OwnerId?

Here is the reference to which fields are indexed

1
  • Thank you again for looking into this. Do we know the sequence the record being scanned? From newest to oldest? Idealy, there will be only two cases left "new" or meet the filtering requirements - won't query thousands of data. I will test again to see if the records will be updated after flow runs. Alternatively, could I get the exact records I need by SOQL or other codes? I don't know the scrips but want to have a try. Mar 6, 2021 at 19:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .