SharePoint workflow formula to format a string...

I have a simple workflow where a value of a Managed Metadata column is copied to the Single Line of text column so I can use it in lookups. The problem is that oob it is copied with a guid and looks like this:

My First Item|7fa249c5-0fdf-421a-84d9-ab501a1815d0

Open in new window

Can somebody help me write a formula I could use in a workflow string builder to remove the pipe symbol and guid from this string?
MisUszatekAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tapiwabCommented:
Try this:

1) Find substring in string in which:

substring is just the pipe | character
string is your metadatafield_0 field
output: index1
2) Extract substring from string with length in which:

substring is your metadata_0 field from the current item
starting location is 0
end is the output of the first step (index1)
output: substring1
0
Rainer JeschorCommented:
Hi,
there is no really elegant out-of-the-box way as String manipulations are (unfortunately) very limited in SPD 2010.

Workaround:
Use the workflow to store the value inside of the string column. Then create a second column of type "Calculated Column" to use this formula:
=LEFT([ExtractedMetaDataFromWorkflow],FIND("|",[ExtractedMetaDataFromWorkflow])-1)

Open in new window


Description:
http://sympmarc.com/2012/11/09/displaying-managed-metadata-column-values-in-an-email-sent-from-a-sharepoint-designer-workflow/

Alternative:
You might want to install this workflow activity extensions - they provide additional string operations/actions:
http://spdwfstringactions.codeplex.com/

HTH
Rainer
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MisUszatekAuthor Commented:
I was afraid I need to do the trick with the Calculated Column but it seems to be working OK. Thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SharePoint

From novice to tech pro — start learning today.