In Robot, a datapool by definition is a constant test asset. If you want to change it on the fly, then part of your entry criteria is that the "datapool" has the values to use in that test - this means you can't use sqaDataPool functions with it.
You'll have to use commands to open & line input etc from a csv file.
If you need dynamic datapool values, then you need to write them from the previous steps i.e. in pseudocode:
No one can give you the code without knowing what variables you need, what objects you are using etc (unless you want us to send you an invoice first...lol)
\\MyFolder\ProjectName\TestDatastore\DefaultTestSc riptDatastore\TMS_Datapools contains CSV files for the datapools.
If you want to change values on the fly, then I guess you can modify the DatapoolName.CSV file, provided it's not locked by another process at the time e.g. Robot already has that datapool open so Windows will tell you to go away when you try to modify it - the trick will be modifying only the cell(s) in question.
For this reason, my original suggestion may still be the better solution, depending on what you're trying to modify. You still have to manipulate the CSV file so that it has the correct number of columns & the new values required. This means you have to open the file, read it all in, determine what needs to be changed & write it all out again. If I'm right, this is no different (and is more complex IMHO) than simply writing a new sequential file to use for the next procedure...
If there is an API or plug-in to simplify this process, I'm all ears...
In any event, I have an inherent distrust of anything which modifies test assets within the project itself. Why waste time with e.g. SourceSafe comparisons when dynamic data is involved? I maintain separate directories:
\\MyFolder\Baseline contains all the stuff to reinstate prior to executing a test & there is a generic procedure for doing this
\\MyFolder\CompareStore contains all the baseline output files which are not specific Robot VPs (which are stored within the project anyway) for file comparison i.e. verified outputs from legacy versions against which outputs from the AUT may be verified
\\MyFolder\DataPools contains all the datapools in the project. When I identify required changes to datapools, I modify them in the baseline datapool, then import them into TestManager.
You could add a \\MyFolder\DynamicDataPools to manage the script-generated datapools for on-the-fly generation...?