Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

How to dot walk from a variable in Catalog Form (sc_task) ?

Happy S
Tera Expert

As per subject, I have a catalog form where one of the variable is named - Owner where it will return the name of the employee that owns the device, and this variable references the sys_user table.

 

So let's say if i were to run a report based on the Catalog form and i wanted to know the employees' job title, how do I do it via dot walking from the "Owner" variable to the sys_user.title field?

 

I tried and it seems the most I can go further is until the variable and nothing else, is there a way to do some scripting to get the required field value in the Report?

 

Thanks a lot !

1 ACCEPTED SOLUTION

Will Wood
Tera Expert

Hi!

 

I can see where the issue lies, and there is a simple workaround. 

I created a variable set, one with the 'Owner | owner_v2' variable and another named 'owner_title'

On the Catalogue Item, I created a Client script as follows: 

function onChange() {
    //When the user updates the Owner field, we pull the title through
    var user = g_form.getReference("owner_v2", populateUserInfo);
}

function populateUserInfo(user) {

    if (user) {
        g_form.setValue("owner_title", user.title);

    }
}

 

 You can then hide this variable or display as read only on the catalogue item. This can then be reported on

 

WillWood_0-1692351285686.png

 

I reported on the sc_req_item table rather than the sc_task table.

 

Hope this helps!

View solution in original post

1 REPLY 1

Will Wood
Tera Expert

Hi!

 

I can see where the issue lies, and there is a simple workaround. 

I created a variable set, one with the 'Owner | owner_v2' variable and another named 'owner_title'

On the Catalogue Item, I created a Client script as follows: 

function onChange() {
    //When the user updates the Owner field, we pull the title through
    var user = g_form.getReference("owner_v2", populateUserInfo);
}

function populateUserInfo(user) {

    if (user) {
        g_form.setValue("owner_title", user.title);

    }
}

 

 You can then hide this variable or display as read only on the catalogue item. This can then be reported on

 

WillWood_0-1692351285686.png

 

I reported on the sc_req_item table rather than the sc_task table.

 

Hope this helps!