cancel
Showing results for 
Search instead for 
Did you mean: 

Unique List of records from an Epicor BAQ

johnw
Executive Chef I
Executive Chef I

I have an Epicor BAQ with a list of Order Transactions that I use within a recipe that's working perfectly.

in a different recipe I want to see a list of Unique Order numbers on this report and didn't want to create a new BAQ

my thought was to execute the BAQ but only retrieve the 3 fields I need which will have lots of duplicates since every order can have multiple transactions.

was hoping there was some way to only show unique records when I execute the BAQ based on the 3 visible fields but don't see anything obvious... is there some combination of pluck and unique that works on a whole record as opposed to just one field in the record? 

John

 

5 REPLIES 5

gary1
Executive Chef III
Executive Chef III

This is definitely doable but it depends on what your end goal is.

If you just want a list of unique IDs, then pluck and uniq will work, like this:

 

orders = [{"id": 1}, {"id": 1}, {"id": 3}, {"id": 3}]

orders.pluck("id").uniq
## returns [1, 3]

 

This assumes you're determining uniqueness based on the ID only.

johnw
Executive Chef I
Executive Chef I

now this is probably a dumb question... not sure where I can add this formula... was thinking I could add it into the loop step but all it allows me to do is add the input list, I can't change to a formula field and do the pluck unique there so then was thinking I could create a list Batch and do it in that step but its not obvious

here s my recipe where Step 3 runs the BAQ and gives me lest say 20 records but only 3 unique records

I do the if to make sure its not empty and then loop through all the records... so it seems pretty straight forward just not sure how t insert this pluck unique before the loop step

Screenshot 2024-10-02 081930.png

 

gary1
Executive Chef III
Executive Chef III

Are you trying to loop through only the unique records?

What you're trying to accomplish is something Workato makes very difficult to do. I'm happy to explain how to do it, but I want to make sure I understand what you're trying to accomplish before I spend the time.

johnw
Executive Chef I
Executive Chef I

yes... I just want to loop through the unique records

where the record would be 2 fields Company and Sales Order number