Skip to main content

Hi All,

We are creating an IT onboarding form in service catalog and not using the out of the box feature. The requester will provide the First name and last name in the form and a third field called Display name should auto populate the values from the other 2 fields as “First name Last Name”. 

Can you advise how we can achieve this ? 

To update a custom field with values from another field, you can use a script or automation tool within your platform. If you’re using a database, an SQL update query could achieve this. For instance:

Ensure to back up your data before executing updates. If you provide more context about the platform or tools you're using, I can offer more specific guidance.


Hi All,

We are creating an IT onboarding form in service catalog and not using the out of the box feature. The requester will provide the First name and last name in the form and a third field called Display name should auto populate the values from the other 2 fields as “First name Last Name”. 

Can you advise how we can achieve this ? 

Hi.

Just double checking.

Are you expecting to populate it in real time and have the field editable so it can be modified in the form?

This could be populated with a workflow, but after the create be created or updated. If you expect this to be done in real time, this would be with a JavaScript script, for instance, done via the browser itself.

You may try:

// plain JavaScript
var first = document.getElementById('firstFieldId'),
second = document.getElementById('secondFieldId');

second.value = first.value;
// Using jQuery
$('#secondFieldId').val($('#firstFieldId').val());

And if you want to update the content of the second field live, you could use the change or keyup events to update the second field:

first.onkeyup = function () { // or first.onchange
second.value = first.value;
};

With jQuery:

$('#firstFieldId').keyup(function () {
$('#secondFieldId').val(this.value);
});

Taken from javascript - Populate 1 form field based on another - Stack Overflow

Of course, you would need to concatenate your first name and last name fields.

 

You may try to use the code above in the portal customization.

 

Best,


To update a custom field with values from another field, you can use a script or automation tool within your platform. If you’re using a database, an SQL update query could achieve this. For instance:

Ensure to back up your data before executing updates. If you provide more context about the platform or tools you're using, I can offer more specific guidance.

We are using Freshservice and in that we have created a Service Catalog form. There I am trying to have this filed which updates in Realtime based on values in other 2 fields. 


@Apssawhney your options to update it in realtime are limited. There’s no processing that occures in the UX of freshservice without more advance scripting or custom applications. 

 

What you CAN do is

  1. Use a business rule to hide the field on the form on new form
  2. On submission, use an expression to Concatentate your first.last name into a string
    1. concat(‘{{First.name}}’.concat(‘.’,’{{last.name}})) with a dot in the middle. 
    2. This should give you Firstname.lastname as a string.
  3. Then, use an action block to set the value of your display name field to the output of your expression. 
  4. This will then be visible on your form for action. 

Remember to replace the placeholders above with your custom fields, and ensure they are wrapped in ‘ ‘ to be text in an expression.


@Apssawhney your options to update it in realtime are limited. There’s no processing that occures in the UX of freshservice without more advance scripting or custom applications. 

 

What you CAN do is

  1. Use a business rule to hide the field on the form on new form
  2. On submission, use an expression to Concatentate your first.last name into a string
    1. concat(‘{{First.name}}’.concat(‘.’,’{{last.name}})) with a dot in the middle. 
    2. This should give you Firstname.lastname as a string.
  3. Then, use an action block to set the value of your display name field to the output of your expression. 
  4. This will then be visible on your form for action. 

Remember to replace the placeholders above with your custom fields, and ensure they are wrapped in ‘ ‘ to be text in an expression.

Hi
I did thought of that. But in my workflow Automator, the action block does not give option to set the value for a custom field. It only shoes the out of box fields or I can add a note. I might be able to achieve it with webhook and API calls. But I was really hoping for a better way here. 

 


@Apssawhney  then it will need to be API, it’s pretty simple. 

 

It’s not the same problem, but the update part will cover you, just replace the custom field / requestor field with yours