Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a name that will always be in this format with varying numbers of _ and - symbols.

e.g. CWTE_4_3-My_Friendly_Name e.g. Inette_5-Friendly_Again

I need to convert these in my sharepoint designer workflow to replace the "_" and the "-" markes with "%2D" and "%5F" respectively.

I tried to do this in my Infopath form but Translate only works across one character limit. so I could replace "-" with "{" but not with "%2D".

Can I do this in Sharepoint Designer? I don't know if I can because the number of the _ and - varies.

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

OK so the solution was here: spdwfextensions.codeplex.com using the Replace() function from the Invoke C# action in SPD. THANKS!!! – April D.

share|improve this answer
add comment

Instead of using a workflow why don't you use a calculated column in the list itself? Go to the list > Click on Settings > Create Column. For the column name enter "Last Name", for the type of column choose calculated. For your formula use the following (replace name with the name of the column where the full name is):

=LEFT(Name,(SEARCH(",",Name,1)-1))

Then to get the first name create another calculated column called "First Name" and use the following formula (again replace Name with your name column):

=RIGHT(Name,(LEN(Name)-SEARCH(" ",Name,1)))

http://social.msdn.microsoft.com/Forums/en-US/sharepointcustomizationlegacy/thread/ac908be0-9fe9-45aa-beae-0e7a968be90e/

check above link it helps......

share|improve this answer
    
How does that solve the question? –  teylyn Mar 20 '13 at 5:24
    
This is not really an answer to the question, besides mentioning of calculated columns –  Robert Lindgren Mar 20 '13 at 8:40
    
Try with Custom Event Receiver or JQurey........ –  Nagaraju Pattem Mar 20 '13 at 10:51
    
that would work if i knew there were only 2 names. but there aren't. there could be 3 or 4 or 5. and there could be an "-" or not. i need a 'loop' function and i don't think one exists for designer. –  April Drake Mar 20 '13 at 16:55
    
OK so the solution was here: spdwfextensions.codeplex.com using the Replace() function from the Invoke C# action in SPD. THANKS!!! –  April Drake Mar 20 '13 at 23:36
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.