Background
A Customer purchases an expansion pack from our website and an API updates the expansion code. I’m comparing the Users Expansions on the API with the Expansions purchased to make sure everything is updated. I created two arrays to compare
I’m using the Array operators: Array length equal to. As you can see from the attached image, the Arrays are not equal to each other, yet the filter passed it.
What is a better Filter to use in order to compare two arrays to make sure they both have the exact same values, because in this example, the filter should have not passed.
just wanted to quickly jump in and pat you on the back for the amazing job with figuring out what was wrong with your scenario. We love to see when Makers come up with the solutions by themselves!
Thank you for getting back here and sharing it with us it helps keeping the community clean.
Good solution @jmacman ! The conversion to Base64 is something I didn’t think of immediately haha.
I had to do this a few times as well, and did something similar (if you are interested):
Sort the arrays in the same way (asc)
join() each array with some delimiter, for example a comma or hastag etc.
Now the arrays are a string, you can compare them with the “equals” comparison
Yep that would work too. I was just experimenting, but the cool this is the Base64 can exactly encode and decode any amount of text even arrays…I thought about making them text with comma delimited as well, but I think so far the Base64 has been working so far.