Need populate quotation in catalog variable

poco
Tera Contributor
  • If the field is empty, then the value must be nothing.
    Preferred First Name = ""

  • If the field is not empty, then the value must include the quotation marks ("").
    Preferred First Name= '"Preferred First Name"'

please help me on this 

1 ACCEPTED SOLUTION

Its_Azar
Tera Guru

Hi there @poco 

Good question and I think you can do this with a client script in the catalog item to populate the value of the catalog variable accordingly

function onLoad() {
    var preferredFirstName = g_form.getValue('preferred_first_name'); variable name

    if (preferredFirstName) {
        g_form.setValue('preferred_first_name', '"' + preferredFirstName + '"');
    } else {
        g_form.setValue('preferred_first_name', '');
    }
}

If this helps kindly accept the response thanks much.

☑️ If this helped, please mark it as Helpful or Accept Solution so others can find the answer too.




Kind Regards,

Mohamed Azarudeen Z

Developer @ KPMG

 Microsoft MVP (AI Services), India

View solution in original post

5 REPLIES 5

Its_Azar
Tera Guru

Hi there @poco 

Good question and I think you can do this with a client script in the catalog item to populate the value of the catalog variable accordingly

function onLoad() {
    var preferredFirstName = g_form.getValue('preferred_first_name'); variable name

    if (preferredFirstName) {
        g_form.setValue('preferred_first_name', '"' + preferredFirstName + '"');
    } else {
        g_form.setValue('preferred_first_name', '');
    }
}

If this helps kindly accept the response thanks much.

☑️ If this helped, please mark it as Helpful or Accept Solution so others can find the answer too.




Kind Regards,

Mohamed Azarudeen Z

Developer @ KPMG

 Microsoft MVP (AI Services), India