How to get the output for two list of items separately in query rule

Certified Senior Developer

Hi 

In below query rule i am passing 2 and 3 product ids so it was returning both 2 and 3 product id's email id's but i want 2 product  id email ids in one list and 3 product id email ids separately means like two list of usernames separately could you please suggest on this 

  Discussion posts and replies are publicly visible

  • Unless the rule DIL_getProductUsers() can be altered to return the list with each User tagged with which ProductId they're associated with (after which you can separate the list into two lists based upon that ProductId) then your only other option is to call the same rule twice, once for 2 and once for 3.

  • a!forEach(
      local!uniqueProductIds,
      a!map(
        productId: fv!item,
        emailIds: rule!getEmailIdsForProductId(id: fv!item)
      )
    )

    The above will result in a list of maps where each map contains the single product ID and any associated email IDs (you would need to fill in correct rule names/syntax/etc of course).  The phrasing in your original post is pretty confusing and lacking in punctuation but I did my best to parse what you're actually after, but apologies if this is off base.