---
title: "system.mes.spc.sample.getSampleList(sampleFilter)"
id: "system-mes-spc-sample-getsamplelist-samplefilter"
project: "MES User Manual"
url: "https://docs.sepasoft.com/articles/user-manual/system-mes-spc-sample-getsamplelist-samplefilter"
updated: 2026-07-31T14:57:30Z
---

# system\.mes\.spc\.sample\.getSampleList\(sampleFilter\)

**Sepasoft MES Module Suite**

### system.mes.spc.sample.getSampleList(samplefilter)

Returns a sample list that matches the filter parameter. Used with [system.mes.spc.sample.data.createFilter(location_path)](/docs/pages/viewpage.action?pageId=60359474).

For sort keys, see [sortType Key](/articles/user-manual/sortType-Key).

**system.mes.spc.sample.getSampleList(samplefilter) → Dataset**

Syntax

system.mes.spc.sample.data.getSampleList**(samplefilter)**

* Parameters

**MESSampleFilter** **sampleFilter** - MES Sample filter to use.

* Returns

Dataset - Samples for a specified location path (equipment path with a sampling location configured).

* Scope

All

Code Example
 
```python
location_path = "Enterprise\Site 1\Area 1\Location 1"

sample_filter = system.mes.spc.sample.createFilter(location_path)
sample_filter.setSortType("Taken Date Time (Descending)")
sample_filter.setLocationPath(location_path)
sample_filter.setStartDate(system.date.addMinutes(system.date.now(), -2))
sample_filter.setEndDate(system.date.addMinutes(system.date.now(), 4))
#sample_filter.setStartDate(system.date.parse("2021-11-05 13:00:00"))
#sample_filter.setEndDate(system.date.parse("2021-11-05 23:00:00"))

sample_filter.setShowDueSamples(True)

sample_filter.setShowComingDueSamples(True)

sample_filter.setShowOverDueSamples(True)
sample_filter.setShowWaitingApproval(False)
sample_filter.setShowApprovedSamples(False)
sample_filter.setShowRemovedSamples(False)
print "State:",  sample_filter.getSampleStateTypes().getState()


results = system.mes.spc.sample.getSampleList(sample_filter)
print results.getRowCount()
print results.getColumnNames()
for i in range(results.getRowCount()):
	row = []
	for j in range(results.getColumnCount()):
		row.append(results.getValueAt(i, j))
	print row
```


**Sepasoft MES Module Suite**