Forum Documentation Showcase Pricing Learn more

CSV Upload (by user)


#1

Hi,
I’ve been trying to let my users upload a CSV with a list of employee names and emails, so that these can be added in bulk to an internal Campaign of theirs.

My data table is very simple at the moment.
Table name: CampaignEmployees
Fields:"

  • Campaign (links to another table called Campaign)
  • EmployeeName (text)
  • EmployeeEmail (text)

Setting:
The user is in their campaign page and only sees the list of CampaignEmployees uploaded for that specific Campaign.
There is a button there for them to download the CSV of that list and a button there for them to upload a CSV to add to that list.
I managed to have Bubble export the CSV of this list with only the CampaignEmployees registered for that Campaign.
However, I cannot make bubble.is upload the CSV when the Campaign column header is in the CSV.
The error I receive in the uploading process is: “This type of field is not supported by the upload CSV action: custom.campaign”

What I have tried:
I took the exact same file that I downloaded by using the csv download button, edited/added lines in the CSV in Excel preserving the same headers and tried to upload it. It doesn’t work. It only works when I remove the Campaign column.
The problem with it is that I cannot allow my users to upload CampaignEmployees without associating those with a campaign.
I also cannot upload these to a temporary table and then run a workflow to convert those into CampaignEmployees because there will be users of different organisations in the app and if they do it concurrently, it will be messed up.

Any idea on how to solve this one?

(I have the feature of adding one by one but this would take ages for the user if the campaign has hundreds of employees.)

Thanks!


#2

It must work with Excel too, but maybe your are not selecting the good separator tab (, ; tab) ? I remember some Excel files was not working, so it’s about format.


#3

I managed to make it work after a break.

@JohnMark, the problem was not with Excel. I was able to open and edit the CSV normally with Excel, Notepad, etc. The problem was when I used the upload function in Bubble and the system tried to match the Campaign text field in my CSV to the Campaign db-reference field in the Bubble database.

But I found a workaround.
I created another field in my CampaignEmployees table called UploadedCampaignID (text)
So, when my user uploads the list of employees, they upload the campaign ID to that text field instead.
I added an extra step as a large popup showing the list of uploaded employees and asking the user to confirm. Upon that confirmation, I run a workflow to link those new uploaded employees to the actual campaign by using that new UploadedCampaignID field.
It actually worked better like this as I can use that confirmation screen to check for upload errors (missing names, wrongly formatted emails, duplicate emails, etc. and only allow the user to commit if those are clear.

But thanks for the reply.
Cheers,