Remove prefix string# from list
-
09-12-2019 - |
Question
How can I remove prefix string#? from list using calculation field.
How can I remove prefix string#? from list using calculation field.
I have column [Nazwa klienta] - this is a calculated column. To this column I put two others columns [Nazwa] and [SAN] - those columns are in other site.
I use this formula:
=[Nazwa]&" "&"("&[SAN]&")"
to receive
Nazwa_klienta (SAN000000)
After that, I create a site columns and use like a reference and use in other list.
Do I need to create two columns? One for the reference column and second for the calculated field?
To be clearly - this STRING;# shows only when I using Word (when I try to pick up a client).
Solution
Assuming your field is called [MyField] you would setup a calculated column with the following formula
=MID([MyField],9,LEN(MyField))
(9 because you want to start at the 9th character, "string;#" has 8 characters)
OTHER TIPS
Given you're using the SharePoint-Online and Office-365 tags, it's like this answer isn't applicable, however the string# issue can be related to a Office 2007 client bug - details here. The hotfix outlines the symptoms and rather than installing the hotfix, I've requested Office 2007 SP3 for the user to fix it.
In c# code, it looks like using SPField.GetFieldValueAsText
return a the value without the extra prefix characters.