GET a list of docs using a list of IDs(names)

Hello,

I am just starting out integrating with ERPNext to gather order information for our nesting system. I am trying to figure out how to get a list of Documents based on a list of document names.

Specific example, in order to run orders through the nesting system I need fields that exist in the job cards and in the parent work order. I am pulling all job cards related to the machine we are running. Then I want to put the “work order” field for each job card into a list and then GET those work orders. How do I setup the filter criteria so that it returns only the work orders in that list?

Does the below work? Do I need separate entries and some kind of OR operator?

‘filters’: '[[“Work Order”, “name”, “=”, “MFG-WO-2019-00001”, “MFG-WO-2019-00002”]]

Thanks,
Tate

@tlundy use

filters: [['Work Oder', 'name', 'in', ['MFG-WO-2019-00001', 'MFG-WO-2019-00002']]]
1 Like

The use case is I want to filter Stock Entries that have a warehouse either as a from_warehouse of as to_warehouse.

Something like:

filters: [['Stock Entry', ['from_warehouse', '=', 'Bodega Central'], ['to_warehouse', '=', 'Bodega Central']]]

but this would be an AND filter, not an OR filter

@CostaRica

filters: {'from_warehouse': 'Bodega Central'},
or_filters: {'to_warehouse': 'Bodega Central'}
1 Like

Muito obrigado!!!

I tried this but it doesn’t work, which is not the same as the format you used, but I assumed that I had to “translate it” to the filters Rest API format

https://ERPNextInstance/api/resource/Stock%20Entry/?fields=["*"]&limit_page_length=25&filters=[["Stock Entry","from_warehouse","=","Bodega Central"]]&or_filters=[["Stock Entry","to_warehouse","=","Bodega Central"]]

@max_morais_dmm, Thanks. That worked perfectly. Do you know if there is full documentation out there for the correct syntax to use in these filter statements?

Thanks again,
Tate

@tlundy the unique documentation I know is the code

1 Like