Discover this year's submissions to the Dataiku Frontrunner Awards and give kudos to your favorite use cases and success stories!READ MORE

how to retrieve list of all datasets of flow with R

Solved!
domantas
Level 2
how to retrieve list of all datasets of flow with R

I have built shiny web app with R, it works fine with manully preset dataset, but I would like to add an ability for user to choose a dataset from flow. So what I would like to do is to retrieve a list of all datasets in flow and then let the user to choose which dataset to upload into app. 

1 Solution
domantas
Level 2
Author

Since I have not found a straight forward solution I come up with one.

So since I wanted to get all the dataset names as list I used dkuManagedFolderPartitionPaths which retrieves all dataset paths from managed folder. The paths look something like this "\dataset_name\.csv.gz". since paths are saved as a list all I had to do was to extract substring between first two "\" and then save it as list. 

paths <- dkuManagedFolderPartitionPaths(name)
res <- str_match(paths, "/\\s*(.*?)\\s*/")
data_list = as.list(res[,2])

View solution in original post

1 Reply
domantas
Level 2
Author

Since I have not found a straight forward solution I come up with one.

So since I wanted to get all the dataset names as list I used dkuManagedFolderPartitionPaths which retrieves all dataset paths from managed folder. The paths look something like this "\dataset_name\.csv.gz". since paths are saved as a list all I had to do was to extract substring between first two "\" and then save it as list. 

paths <- dkuManagedFolderPartitionPaths(name)
res <- str_match(paths, "/\\s*(.*?)\\s*/")
data_list = as.list(res[,2])

Labels

?
Labels (4)
A banner prompting to get Dataiku