Forum Academy Marketplace Showcase Pricing Features

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