1) Remove any "where" clause from the report object to load all the data into select field
After the form is loaded, default selection should be shown in a second or two.
Original Message:
Sent: Mar 12, 2025 02:12 AM
From: Peter Schmidt
Subject: CA Service Catalog - script - how to get current user
Hi Satya Kiran,
thanks for your guidance.
That's the way I tried it now and it worked but not the way as I'm looking for.
When filling Report/Plug-In Variables as described, preselect is done and no other dataset can be selected, means - query is done with value given and no other contacts (in my case) are selectable.
What I'm looking for is a way to DEFAULT selection in the selection-field and having the chance to select another contact as the defaulted in my case. All contacts should be selectable but the logged in user should be defaulted in the select field.
What I tried now is to write a script-function (in custom_form_examples.js) which is called as onLoad of the field.
There I have called
ca_fdFetchSelectData(FormID,FielID);
and then, in a setTimeout, I call with fix parameters
ca_fdSelectOption(FormID, FielID, 'myLastname,myFirstName(myUserid)', 'myUserid');
This is working, but slow.
When I'm trying to use _.userid.<something like last_name> for the parameters,
I found $(_.user.id) (tested with F12) undefined in script.
So, what can I do to default selection with the logged in user?
Thanks and regards,
Peter
Original Message:
Sent: Mar 12, 2025 12:58 AM
From: Satya Kiran Jasti
Subject: CA Service Catalog - script - how to get current user
Hi Peter,
Syntax to pass the query variable is like $({'<variable_name>':'value'})
Ex: for OOTB report data object 'catalog__content_country_list'
Query : SELECT id,name FROM ca_country WHERE (ca_country.name like N'%%%STRING%%%')
Select Box Parameters will be
Report/Plug-in Id: catalog__content_country_list
Report/Plug-in Variables: $({'STRING':_.user.location.country})
Regards,
Satya Kiran
Original Message:
Sent: Mar 11, 2025 04:57 AM
From: Peter Schmidt
Subject: CA Service Catalog - script - how to get current user
Hi,
on form-level I get the correct data for _.user.id
--> Text-Field's value shows the logged in user-id (cnt.userid)
But when I try to use it for the query of the user-select-field, it doesn't work:

query seems not to run.
Testing the report by typing the userid - also is working correct.
Any idea?
Original Message:
Sent: Mar 07, 2025 01:29 AM
From: Patrick_Price_10294
Subject: CA Service Catalog - script - how to get current user

Original Message:
Sent: Mar 06, 2025 07:38 AM
From: Peter Schmidt
Subject: CA Service Catalog - script - how to get current user
Hi all,
in form - javascript I would like to preset an user-select-field by the current logged in user.
How can I get current logged in user?
Something like ca_fd.GetCurrentUser() would be great.
Or is there any ca_fd-variable containing current user?
Something like
var ActUser = $(_.user.id).selector; _.user is undefined
runs into an error.
Thanks,
Peter