In Flow Designer trying to populate Assignment Group of a Catalog task based on another variable

c_d_mitchell
Giga Guru

Background.

I have a reference variable called desktop_support.   It populates from an onchange client script which grabs the current user location and finds this custom reference field on the Location table that references the Group table.

c_d_mitchell_0-1690497920055.png

 

When creating the catalog task, I thought I could simply do.

c_d_mitchell_1-1690497981547.png

 

But it never fills.  

I run the test and this is the value I'm getting which I'm confused about.   Doesn't seem to be a sys_id or a string value

c_d_mitchell_2-1690498113856.png


Any suggestions on how to accomplish this would be great.    I tried script as well.    But did not populate.

c_d_mitchell_3-1690498226785.png

 




 

 

2 REPLIES 2

Sandeep Rajput
Tera Patron
Tera Patron

@c_d_mitchell would it be possible for you to share the code of the onChange client script. Also, can you see the value in desktop_support field on variable formatter aftrer the request is created?

JPing
Tera Expert

Assignment group needs to take an sys_id of an assignment group. The Location table does have a "managed_by_group" field. So as long as in your script you are setting 

desktop_support = <user referenced variable>.location.managed_by_group; Though I think dot walking reference fields are not that simple in client scripts and you need to use g_form.getReference().

 

But you know what, I would avoid using Client scripts all together and not creating pointless variables to be set in the front end to be used in the backend. In the flow, you know the user because the catalog item will have reference to opened_by, or you have user reference field in your variables. In the flow just dot walk from the user to the managed_by_group field (in location table). You can use the pill picker or something like this in a script:

return fd_data._1__get_catalog_variables.requestor.location.managed_by_group

or

return fd_data.trigger.request_item.opened_by.location.managed_by_group

 

I try to avoid using client script if it is just to pass information to the backend processes. Client script are ideal for validation, or providing feedback to the user. You have access to the same variables in the backend, why create more objects you have to manage on the front end for backend purposes