Bulk Uploading into Postgres on CSV File Upload Button

Hit a snag. Looked around for documentation and only saw docs on when doing via JSON/API.

Example here is bulk inserting prices for some products into a staging table we have before price changes happen.

I need to be able to use file button to select the csv and on click of upload button it runs a bulk insert SQL command back to a postgres table.

I have the button setup for upload, and for upload to run the bulk_upload "bulk insert records" via GUI mode but am unsure how to get this to work as when adding the array of the file button it does not work. Guessing that last part is wrong.

You can use the Event Handler on that fileInput component - use either parse or change - not sure which one...

@ScottR filebuttons now have a parse toggle which I already had on. Wouldn't that do the trick? I tried doing what you said to no luck.

the event itself is when parse occurs then your bulk update query should fire

1 Like

Thanks. I figured out the issue. Was the array snippet. Instead of filebutton1.Value it would be

{{fileButton1.parsedValue['0']}}

So was it adding the event handler for Change or Parse that resolved it?... good to know for future readers...

parse in the event handler :slight_smile: