I am new to scripting but working hard at learning. The following snippet probably won't solve your need immediately but might help. It has worked for me so far but I haven't tested yet in the real world. This was pulled and modified from this forum. Maybe it will give you some ideas.
var mydataMergeProperties = app.activeDocument.dataMergeProperties;
var selectDataSource = "Data Merge: *.txt";
var myDataSource = File.openDialog("your message here");
This bit assumes that you want to have a dialog to browse to your data source, you could replace with the path.