0

I currently have the following query to select the id of a single product, like so:

client.post(`https://merck-nextgen.veevavault.com/api/v18.3/query?q=SELECT id FROM product__v WHERE name__v = '${VOLT_CREDENTIALS.get('cred').productName }'` , args , function( data , res) {
            //console.log( 'PRODUCT ID IS ' + data.data[0].id);
            productID = data.data[0].id;
            resolve("Product ID retrieved ...");
});

But what if I have multiple products, i.e. maybe more than one, how do I go ahead and select the id's of multiple products using the same query as above?

I am using nodejs and VQL.

Right now the value of VOLT_CREDENTIALS.get('cred').productName is just "demoproduct". So how do I go about selecting the id's of multiple products?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Alexander Solonik
  • 9,838
  • 18
  • 76
  • 174

1 Answers1

1

Instead of the filtering condition:

WHERE name__v = '${VOLT_CREDENTIALS.get('cred').productName }'

you can use:

WHERE name__v = '${VOLT_CREDENTIALS.get('cred').productName1 }'
   OR name__v = '${VOLT_CREDENTIALS.get('cred').productName2 }'
   OR name__v = '${VOLT_CREDENTIALS.get('cred').productName3 }'

You get the idea.

The Impaler
  • 45,731
  • 9
  • 39
  • 76
  • thanks for the answer , it can't be an `or` though , if its 2 products , i need the id's of both , if 3 products , i need the id of all 3 :) – Alexander Solonik Dec 19 '18 at 22:30