How to access/output basic variables in Smart Views?

Ember/Javascript is not my specialty and I’m struggling to do some basic stuff.

I just want to output the ID of the parent into my Smart View.

i.e. this is the URL: https://app.forestadmin.com/[project]/Staging/IT/data/acpCohorts/index/record/acpCohorts/111179/has-many/acpCohorts-acpEnrolments

I want to output 111179 into the template. How do I do this?

Hi @Owen_Kavanagh :wave: and welcome in our community !

You can access the parent record id like this:
In your JS:

this.args.parentRecord.id

In your template:

{{@parentRecord.id}}

Let me know if this is what you are looking for :slight_smile:

2 Likes

Hi Vince,

This variable has suddenly stopped working for me unfortunately!

Do you have any idea what’s happening here and/or is there documentation for this for me to look through? I can’t find any reference to parentRecord anywhere.

Thanks in advance!

Oh yes, I’ll fix it. Sorry about that

The issue should be solved. Let me know if it’s okey on your side :folded_hands:

1 Like

Yes, all is working perfectly now - thank you!

1 Like