Showing One To One Relationship via Details

We have a single 1 to 1 one between 2 tables that we want to display in the Details section of the parent. Currently, we only see a single field option to show:

Ideally, we’d like to be able to add a custom view to the parent’s details section that contained the Smart View of the child table similar to this sample view from your docs:

We can see the related field showing up as a field in Forest and not the actual related data:

This allows us to add the field to a section, but that’s about it. Any suggestions on adding in a full view?

Hello @David_Panzarella,

Thanks for reaching out :raised_hands:

To be sure I understood what you would like to have, can you tell if this is right:
→ You wish you have a built-in component that is displaying all information of a BelongsTo relationship (in the summary view for instance, same way we can add a related data)?

Such built-in component does not exist yet.

However, you probably can fit your need with a smart field.
You could, for instance, create a field that is an object containing all the belongsTo relationship fields that you want to see. Then, you just have to display this field in your Details/Summary view to see all the needed information at a glance.

Let me know if this helps.
Thanks!

That’s correct: a BelongsTo relationship as such:

    Beacon.belongsTo(models.TalentQueue, {
      foreignKey: {
        name: 'talentQueueId',
        field: 'TalentQueueID'
      },
      target: {
        name: 'ID',
        field: 'ID'
      },
      as: 'TalentQueue'
    });

In my case, a SmartField won’t do much as a Talent Queue for us is a list of users in different states. I think this would be a worthy feature request for Forest to consider since it’s already something you have now for other relationship types; even if only for the Summary views.

One temporary solution that may work is if we could set the link to go to the Talent Queue’s List view with a filter of the TalentQueueID. Something like: /data/TalentQueue/index?search=144 instead of /TalentQueue/144/details. Any suggestions you have will be appreciated!

Thanks again for the reply.

@David_Panzarella,

If I understand well, what you wish to have is a direct association between a Beacon and its list of users from the Talent Queue?
So in Forest Admin, being able to see Talent Queue users list in the related data of Beacon?

This is possible thanks to smart relationships.
See this documentation and let me know if it helps.

Thanks.

Thanks for the follow-up. That’s correct but as I am using a SmartView to filter down that TalentQueue List, I wanted to link from the Beacon (parent) to the Talent Queue List (child and smart view) filtered down to that specific Talent Queue… showing only that list of Talent for the Beacon. From what I can tell a Smart Relationship doesn’t allow me to change the link right?

@David_Panzarella,

What you could do is to add to the Beacon collection a smart hasmany relationship of users from the Talent Queue. You can select only the talents for the specific Beacon of course.
This way, you will be able to display those talents as a related data of your Beacon.

Let me know!
Thanks.

Thanks for the reply @anon34731316. I’ll give that a try.

On a different note, I mistakenly messed up one of my smart view’s components. Is there any way to retrieve it via a backup? I believe we are on an enterprise plan.

@David_Panzarella for your second point, if it’s still an issue, can you open another thread so that we separate the concerns?

Thanks!

I was able to retrieve an older copy of the smart view from another backup. Thanks for the follow-up!

1 Like