I have a use case where I have an array returned from AWS S3 but it produces too many results that are not needed for the user to see. I have an exclude list in a text box component that I would like to compare to the S3 array and have the js query filter out all values in the exclude list to get my final result set. So far I have not been able to get this to work, the js code I tried is below:
It doesn't seem like this filters at all, when I run this I get all 7 results, when in fact I should get 5 results based on the exclude list(I only have 2 items in the exclude list for my testing). It's Can someone please help or have any ideas? Thanks
Hi @ScottR Thanks for your quick reply, I am fairly novice with javascript, so I am not sure how to approach that function. Is it possible you could provide an example?
No problem. Except I won’t be able to post until tomorrow morning. Maybe some one else will chime in before then. If not I will follow up. Apologies for the delay.
Hi @ScottR Thank you for the prompt response, unfortunately this does not work either, seems like no matter what I try the key's i need don't filter to what is intended. It does work though if I put values in quotes like:
const mainArray = ["apple", "banana", "orange", "kiwi"];
const subArray = ["le", "an"];
The outcome here would be to be left with the result key "Test/FID/Caremark/To_Accolade/FID_CM_RXCLM_20200304192335989731199123txt.gpg" based on taking out the values with a substring of CONFIG. This data is coming from S3 API. I am wondering if I need to convert to strings?
Hi @ScottR So I will need to use the _.omit function then as I want the opposite behavior(I want the mainArray to contain keys that are not in the subArray), still though in my sample data even with _.pick I should still only get the keys with CONFIG in them, correct?