HPE Service Manager / Service Center Support and News Forum
Showing results for 
Search instead for 
Do you mean 

Populate Array type value to Character type field in a form, in the format ABCD not {"ABCD"}

Trusted Contributor

Populate Array type value to Character type field in a form, in the format ABCD not {"ABCD"}

Hi Experts,

 

I have a field named as DIVISION which is linked to another field of array type.

Now whenever I click on fill in the DIVISION field, the value is displayed like {"ABCD"}, whereas I want the value to be displayed as ABCD.

How do I get it to work? Do I need to write a javascript so that the value gets trim before it gets populated in the field? If so then please help me with a script.

 

Thanks.

Sanjeev

4 REPLIES
Valued Contributor

Re: Populate Array type value to Character type field in a form, in the format ABCD not {"ABCD&

Hi

 

Can you check the link from where the data is being populated . Check for the query in the link record

Highlighted
Honored Contributor Honored Contributor

Re: Populate Array type value to Character type field in a form, in the format ABCD not {"ABCD&

Hi Sanjeev,

It is because you have array type mapped with character also it is not correct that you link character to array type filed, because what happens in case of multiple value are there in array field.

However to correct it, put in respective link line, in Post Expressions as,
DIVISION in $File=strraw(DIVISION in $File)

hth,
____________________________________
Assign Kudo, if found post useful and mark it accepted if solves the issue.
Trusted Contributor

Re: Populate Array type value to Character type field in a form, in the format ABCD not {"ABCD&

Hi Piku,

 

Can you please explain the usage of "strraw".

 

Thanks,

Sanjeev

 

Honored Contributor Honored Contributor

Re: Populate Array type value to Character type field in a form, in the format ABCD not {"ABCD&

Hi,

It just convert array type to string and removes the curly braces and commas of array value.

e.g
array= {"val1", "val2", "val"}
after strraw()
array = val1 val2 val3

hth
____________________________________
Assign Kudo, if found post useful and mark it accepted if solves the issue.