How to export identities array and user_metadata object

I’m following these docs: https://auth0.com/docs/users/bulk-user-exports to try and export my users. Everything is working.
I know we can use identities[0].connection to get a specified element, but currently, I want to export all the elements in the identities array and user_metadata object but I cannot find any docs about it.

Then endpoint I used: /api/v2/jobs/users-exports
And the payload:

{
    "connection_id": "con_01111111111111",
    "format": "csv",
    "limit": 10,
    "fields": [
        {
            "name": "created_at"
        },
        {
            "name": "email"
        },
        {
            "name": "identities"
        },
        {
            "name": "user_metadata"
        }
    ]
}

But the results are empty, even though we have identities and user_metadata data exist.
Could anyone help me?

Hi @hapham

Can you give more info? I’m confused. You say both “Everything is working” and “the results are empty”.

The full query you are running and the results (truncated and obfuscated as needed) would be helpful.

Both the identities array and the user_metadata should be in the output.

John

Hi @john.gateley
I meant the result of identities and user_metadata fields are empty, the other fields are OK.
The result I got:

created_at,email,identities,user_metadata
2020-08-07T20:48:49.221Z,lilya@aol.com,,
2020-08-07T22:48:49.957Z,amisher@gmail.com,,

At a guess, I’d try JSON format instead of CSV. Since the identities and user_metadata fields are not simple objects, the CSV format may not know how to export them.

John

2 Likes

Oh, yes! It should be JSON! Silly me!
Thank you very much!

1 Like

No worries! We’re here for you!

it is JSON.Thanks you

1 Like

Teamwork makes the dreamwork!