how i can show actual values ​for ReferenceField in mn csv.file when i export my page from React Admin?

65 Views Asked by At

When i export the page from react admin. The REferenceField's Values doesn't appear in my csv file. It shows me just the value of Id

const PostListActions = (props) => (
<TopToolbar>
            <SelectColumnsButton />
            <CreateButton />
            <FilterButton />
            <ImportButton {...props} />
            <ExportButton />
       </TopToolbar>
   
)

export const GalleryList = () => (
    <List  actions={<PostListActions />} >
        <DatagridConfigurable >
            <TextField source="id" />
            <TextField source="nom" />
            <DateField source="createdAt" />
            <DateField source="updatedAt" />
            <ReferenceField source="paintId" reference="paintings" />
            <EditButton/>
        </DatagridConfigurable>
    </List>
);
```[csv.file](https://i.stack.imgur.com/VT6bB.png)[My page react admin](https://i.stack.imgur.com/Xaoa6.png)
 

I didn't find a solution[Export Button](https://i.stack.imgur.com/VDfD1.png)
2

There are 2 best solutions below

1
MaxAlex On BEST ANSWER

You have an error in using ReferenceField, it should be like this:

<ReferenceField source="paintId" reference="paintings" />
    <TextField source="you_field" />
</ReferenceField>
0
John McCabe On

The react-admin <List/> component has an exporter prop that may be useful to you. https://marmelab.com/react-admin/List.html#exporter