Copy link to clipboard
Copied
I'm fairly new to ColdFusion. So, forgive me if this is a stupid question.
I'd like to populate a cfgrid with data from a csv file. Is there any way to do this? I know I can read in the file and put it into an array of structs. Is there a way to use the array to populate the cfgrid?
Thanks,
Nicole
Regarding:
Thanks again, all my googling was leading me to believe it wasn't possible.
Au contraire mademoiselle. As cfsearching said, CFHTTP can convert (well formed) csv files into queries. When you google "cfhttp" and find the adobe docs, pay attention to the name attribute.
Copy link to clipboard
Copied
You can populate grids manually by looping and using cfgridrow . Alternatively, you could also convert the csv file into a query, instead of an array. Then you could use cfgrid's query attribute. CFHTTP can convert (well formed) csv files into queries. There is also the CSVToQuery function from cflib.org.
Copy link to clipboard
Copied
Thanks! So many options! I had checked cflib.org, but apparently used poor search terms. Since I have control over the format of the csv file, I can use your ideas for turning my file into a query, that way I don't have to control paging. Thanks again, all my googling was leading me to believe it wasn't possible.
Copy link to clipboard
Copied
Regarding:
Thanks again, all my googling was leading me to believe it wasn't possible.
Au contraire mademoiselle. As cfsearching said, CFHTTP can convert (well formed) csv files into queries. When you google "cfhttp" and find the adobe docs, pay attention to the name attribute.