Export to CSV workflow, can I not change related objects fields from "unique_id"?

I posted this before but didn’t get any replies so wanted to try again as it’s something we need to work. If I have for example a “Leads” object, it then has a few look up fields, like “Assigned To” and “Sales Rep” which are User fields where you select a Bubble user from the drop down and it shows their full name on the layout.

The problem is that when I export to CSV using Workflow all Leads, all the User lookup fields just show the users unique ID. For the created by it does this also but then adds a “Created by - Email” and shows that there. Is there no way to have the other lookup values show the same?

It’s similar if you have an Accounts object, relating to multiple Contacts. On the Contact you select the Account, but when you export the Contacts to CSV, the Account column shows the bubble unique ID vs the Account Name.

Is there a way to make this work?

Hi @lmoreau,
Use “Define primary display fields” to change the primary field of the table to anyother primary fields on that table like Account name.

App editor -> Data -> App Data -> Primary Fields (popup will show to change the primary field of the each table.)

Just getting around to trying this now but it doesn’t work. I already have all my primary fields set there but it doesn’t work on CSV export, only if I export to CSV from the bubble editor. If I use a Workflow with a button that says export to CSV it doesn’t.

image

See user above, I have it set to show email as the primary field.

Yet on a CSV export it just shows their ID:

Same with Company, the primary field is set to Company Name:

image

Yet the CSV shows:

image

Hi,

try to use othe csv export options available on Plugins.
otherwise please share the app editor, will check and get back to you.

Did anyone get a fix for this? Currently trying to download app data which includes users email, but is downloading as their unique id’s.

As mentioned somewhere above, if you set the primary field output to be something other than unique ID, you will get something different on CSV output. Witness:

Click this:

Now set the primary field output for User from (for example) Unique ID to Email:

Just to make it ridiculously clear:

Now, upon CSV export you (should) get:

That is, UID had been replaced by creating user’s email.

Aside: About a minute of testing shows that this is the case. Test.

Spend a minute testing this on literally any data type/field combination besides the User/email. Very different results :face_with_monocle:

Well then that’s perhaps a limitation that could be removed and that feature request could be made via the bug report form.

Aside: I was surprised you could even get User’s email to appear in the output CSV, and seeing that assumed that manual CSV output respects the friendly field settings.

But note that - for Thing type database fields - the UID is the Thing. (That is, if that string is passed to a Bubble input or output of Thing type, the Thing itself appears. Similarly the UID can be used to fetch the Thing’s fields via the data API.)

Outside of the App Data section of the editor, there’s nowhere else in Bubble where we can see a Thing’s field values all together without explicitly fetching them.*

So at least CSV output is consistent in this respect (and correct).

  • You might wonder: How are Things represented internally in Bubble? Are they JSON-type serialized objects with key/value pairs? No. They come to us as an object with two functions on it, listProperties() (which tells us its fields) and get() (which fetches the value of some field) and we don’t know anything about the Thing until we execute those functions.

Interestingly, this object is more or less interchangeable with its unique ID. We can publish this object OR the string of its unique ID to Bubble and Bubble understands either as the Thing itself. (And this is how Run JavaScript can pass Things back to Bubble.)

RT^ it doesn’t work for other data types

Hey,

This idea is posted on the Ideaboard. So you can go ahead and upvote it. :slight_smile: :computer:

Hi Everyone,

It is an old post, but I am unshoveling as I am surprised there is no solution to this “simple” problem.
I have the same use case than @lmoreau as I want an app user to be able to export csv data. Therefore I am using a workflow and not the “export” button in the editor.
The primary field are well defined and if exported through the editor there is no problem.

But When it comes to workflow and action “download as csv” , I just have unique_ids eventhough primary fields are well defined on other fields than unique Id.

So, is there a simple way to export data as csv for app users without having to use some sort of :format as text

Best regards
JR

Hello

Did you find solutions for this?

I ran into this exact issue before :sweat_smile: Bubble’s CSV export workflow is kinda annoying with related fields. Instead of exporting the actual values, it just spits out the unique IDs for linked objects.

From what I found, changing the “primary field” only really works in some cases (like User email), but not consistently for other related data types.

Honestly, the easiest workaround is usually building the export from a repeating group or using a CSV plugin instead of the default workflow export. The built-in export feels super limited once relationships are involved.

I agree,

I opted for a plugin to get the data off the repeating groups.
Works like charm.