Search for value containing a string in array


  1. Take an array of Salesforce cases and find all matching ( based on caller telephone number) call recordings from an array recordings from an AWS S3 bucket
  2. Optimize the scenario as much as possible as the amount of Salesforce cases and Call recordings can get decently high

Steps Taken:
I am iterating through my array of cases, and using this function {{get(map(10.array; "value"; 10.array[].$1; 21.Technician Parsed + "," + 21.Technician Parsed +1))}} to try to pull the value that matches the phone number of the recording. My scenario will run without any errors but it will also not find any matches. I’ve manually went through the outputs and there are obvious matches that it’s not catching. I’m not sure what I’m missing here.

Here is my current process, the bottom route being the one in question.

First I grab all new cases from Salesforce and put them into an array called Case Array[1]. The important field each collection is the Technician Phone as this is the phone number that will be used to try to match to a call recording. The format of this phone number is not consistent so I will parse this field in a later step.

Next I grab a list of files from my AWS s3 bucket. For this matter the only field of importance is the filename. The Compose a string[8] module just creates a custom url string with the filename and the Text parse[18] module parses the phone number that I will be comparing to from the case out of the filename. These two items are then aggregated into an array called Recordings Array[10].

Following the bottom route I then iterate through Case Array[1]. Here I set two variables, one with the parsed number from Technician Phone called Technician Parsed and another with a 1 in front of it ( the call recording is inconsistent with having the 1 or not so I’m trying to account for both ) called Technician Parsed +1.

Finally, I try to use the get and map functions to find the the parsed phone numbers in Recordings Array[10]. I’m trying to get the field called value which is the URL I composed earlier. I’m searching the phone number parsed from the filename which in the array raw label is $1 The likely values being the two variables set in the previous step.

All of my results are empty, even though I have gone through the outputs and see that there are positive matches ( I can’t show the outputs unfortunately as they are my customers actual phone numbers )

Any help would be greatly appreciated! FYI, I have another solution where I simply iterate every call with each iteration of my case array. Though that works ( most of the time ) it eats up a lot of my operation count every time it runs.

So after rereading how the get function works, I realized I had to indicate an index. But this is under the assumption there is only 1 match. I will have use cases where there are multiple matches as the customer may have called in multiple times and I need to make sure I get all calls attached to each case that has their phone number. The video tutorial states that there is a way to get multiple matches but it does not explain how. So I guess my new question is how do I get all matches instead of just the first?