How to check if an array of strings contains the identical string of another array?

Actions & Logic

Hi there,

It has been a long time since I have asked for help on here, I've always been blessed by the FlutterFlow community. I would once again been grateful for your assistance:

I have two string arrays, I need to check if any of the strings in the first array are identical to strings of the second array.

Furthermore, if there is a match.. say for example array[0] matches array[4] then I will generate X message, but if array element[0] is equal to array element[3] then Y message.

(May or may not be useful to know... both arrays will always have a maximum of 5 strings, the first array may have any number of 1-5 strings and the second array will always have all 5).

P.S it is quite difficult to explain this in clearer terms, I am struggling to decide on whether to use a loop.. and how to use filters i.e "list contains item" filter on one array and which filter on another.

Thank you.

What have you tried so far?

Since the first array may have any number of 1-5 strings and the second array will always have all 5... logically I know that I must somehow go through each element of the first array and compare that to each element of the second array.

I have so far stored the number of elements of the first array into a variable called "maxCounter". I have also set a variable called "counter" to 0. So this way.. I can somehow loop through each element of the first array and compare it to all 5 elements on the second.

Did you check FlutterFlow's Documentation for this topic?
Yes
1
9 replies