SelectFromFile: Select Rows with Values From CSV/Excel File

Tag: SelectFromFile

Achieve row selection with values found in a CSV file.

Cf. Select: Select Rows


XML
<SelectFromFile FilePath="C:\dev\Temp_XML\selectFromFile.csv" HasHeaders="True">
	<SetParam Field="userType" Value="3"/>
</SelectFromFile>


Tag Attributes

Attributes

Attribute Values

Value Description

FilePath

File path

Path of the CSV or Excel file that holds the selection values - Required

HasHeaders

True / False

Whether the first row of the file holds column headers

And

True / False (Defaults to False)

Restrict or enlarge selection key

Target

Grid name

Optional: identifies the grid. Not needed in sapio365.

Detailed Description

For each selection value, one SetParam is required with:

  • Field = grid columnID

  • Value = column rank in CSV / Excel file

Example (Users module in sapio365): 

name

(index: 0)

weight in kg

(index: 1)

age

(index: 2)

type

(index: 3)

job title

(index: 4)

city

(index: 5)

continent

(index: 6)

George

199

68

Member

engineer

Cairo

Africa

Rodolf

77

31

Member

engineer

Redmond

Atlantis

Michele

29

51

Guest

Consultant

Tulsa

North America

Example Script

SelectFromFile

XML
<ytriaAutomation>
	<SelectFromFile FilePath="C:\dev\Temp_XML\selectFromFile.csv" HasHeaders="True" And="true">
		<SetParam Field="userType" Value="3"/>
		<SetParam Field="city" Value="5"/>
	</SelectFromFile>
</ytriaAutomation>

automation-grid-selectFilterFromFile-1.gif


automation-grid-selectFilterFromFile-2.gif

automation-grid-selectFilterFromFile-3.gif