I have a price list in JSON:
{Products: [{AdminID: 137, ProduktID: "07.1434", itemName: "Repaplast", itemColor: "0000, 5030", MalKode: "1-3", …}{AdminID: 6, ProduktID: "07.1436", itemName: "Repaplast grå", itemColor: "0070", MalKode: "1-3", …}{AdminID: 146, ProduktID: "90.0905", itemName: "Mixer Gun", itemColor: null, MalKode: "", …}{AdminID: 89, ProduktID: "02.0135", itemName: "Repaplast Primer NEW FORMULA", itemColor: "", MalKode: "5-3", …}]}
The list is about 400 products long.
Say I want to limit the list showing only specific products based on the field ProduktID (which is unique). Let's say I have a list of products in an offer:
07.1438, 01, 1340, 05, 04531, 02.0135
Where comma is the separator.
How can I .grep or .map the objects array based on these inputs?
Do I have to search one by one and then combine the results into another object? Or is there a faster way?