Get first & last name of a user into calculated text field
Is there any possibility in archer where in a calculation field (of type text field) to get the value of first name, last name of a user which is selected in record permissions field
I can add more info, in case required.
- Community Thread
- Forum Thread
- record permissions
- RSA Archer
- RSA Archer Suite
Hi there. I actually just successfully implemented this functionality in a test application, but it required using a custom object. I did it in 5.5, here's some of the code (which assumes only ONE username selected in the User Groups field). For reference, field 19137 is the User Groups field and field 19136 is the text field that I'm assigning the first name to. I set a trigger elsewhere in my code that overrides the save/apply buttons so that this text field is set to the "first name" from the user groups field every time one of those buttons is clicked.
var names = $('input[id*="f19137"]').val();
var arraynames = names.split(",");
var name = arraynames;
name = name.slice(1,name.length-1);
var textFieldAttributes = new Array();
$('input[id$="'+ 19136 +'c"]').val(name);
$('input[id$="'+ 19136 +'c_ClientState"]').val(textFieldAttributesSerialised);
Basically, when you extract the value from the User Groups field you get a JSON string. I could've formally parsed the JSON string, but instead just tokenized it (,) and pulled out the value where I knew the first and last name was located. Then I chopped out the last name and leading whitespace.
mentioned Script didn't work on 5.5 Sp2, am i missing something here?
I did copy your script and put it in custom object,replacing field id's .but could nt able to see any output.
With the advent of calculated cross-references, getting a user's name into a calculated field is possible if you're mirroring your users as records within the Contacts application (for those who have it licensed). Simply create a calculated cross-reference to the Contacts application doing a field value match from the RSA Archer User Account Field in the Contacts application to the Record Permissions field from which you're trying to get the name. Then create a calculated field to concatenate the Name (Last) and Name (First) fields in whatever order you need.
For example if your calculated cross-reference was named [Contact of Submitter] your formula for Submitter's Name would be:
CONCATENATE(REF([Contact of Submitter],[Name (Last)]), ", ", REF([Contact of Submitter],[Name (First)]))