How can you use a specific row from a writable datasource in a subsequent test?

in SOAtest
I created a writable datasource that is populated with anywhere from 5 to 20 rows of data in a REST GET command. In the next test, I would like to always use row number 5 of the datasource as a parameterized value in a POST command. Is there a way to do this. I have searched the help and have not been successful in finding a way to do this. Thanks
0
Comments
Hi Brian,
If you want to use a specific row from the datasource, the best way to do this that I can think of is to use a scripted value instead of parameterized.
When you click the Edit script button when script is selected, paste this in with Groovy as the selected language:
In your case, "New Datasource" should be the name of your writable and "test" should be the column name.
Hope this helps!
Yes, this helps immensely, thank you
Hi
context.getValues("New Datasource", "test").get(4);
in "New Datasource" we have to provide the absolute path of the excel workbook
Please correct me if i am wrong.
Hi Kamit,
For "New Datasource," you do not have to provide the absolute path. Instead, provide the name of the Excel Datasource that you are using for that specific test. In a similar script for the example screenshot below, the line would be
context.getValues("Books", "title").get(4);
Hope this helps!
In data sources, you do not have to provide an absolute file path to an Excel/CSV file. You can use variables. Here are the examples I found in the SOAtest User's Guide:
However, this is something you configure in the data source itself. As Thomas mentioned, in your script you only refer to the data source by name.