Join string issue - additional separator at end of string

by gizmo3k » Wed Sep 07, 2016 8:41 am

Good morning,

i hope someone can help. I am trying to copy a document from a document set to another document set. and am having several issues.

Unfortunately this particular file has parenthesis in the title, which is preventing me from copying the file (invalid characters in the URL). I thought I could replace the '(' characters with '%28' and the ')' characters with '%29' however I am getting additional characters at the end:

My file name is Actions Tracker (Monthly Review)

If I try

Set Variable: DocumentName to Current Item:Name
If Variable: DocumentName contains (
Split Variable: DocumentName using ( (Output to Variable: split result )
then Join Variable: split result using %28 and ({0}) (Output to Variable: Result string )

I get the following output:

Variable: DocumentName = Actions Tracker (Monthly Review)
Variable: split result = ["Actions Tracker ","Monthly Review)"]
Variable: Result string = Actions Tracker %28Monthly Review)%28

How can I recombine this string without the additional '%28' at the end?

Note after this I am using

Copy document from [%Workflow Context:Current Site URL%]Docs/Stage [Variable: CurrentItemStage%]/[%Variable: Result string%].[%Variable: FileExtension%]

which translates as https://tenancyname.sharepoint.com/site ... Docs/Stage 6/Actions Tracker %28Monthly Review)%28.xlsx

Removing the additional '%28' from this url does allow me to open the document successfully, so I believe the URL is valid.

Also, if there is a better way to do this, please feel free to suggest it!

Thanks

Gizmo3k
gizmo3k
 
Posts: 9
Joined: Fri Aug 12, 2016 2:00 pm

by Evgeniy Kovalev » Wed Sep 07, 2016 1:42 pm

Hi,
Thank you for your message.

You can try to use "Replace" action for your task.

Best regards
Evgeniy Kovalev
Plumsail Team
User avatar
Evgeniy Kovalev
 
Posts: 58
Joined: Wed Jul 20, 2016 2:13 pm

by gizmo3k » Wed Sep 07, 2016 2:04 pm

Evgeniy Kovalev wrote:Hi,
Thank you for your message.

You can try to use "Replace" action for your task.

Best regards
Evgeniy Kovalev
Plumsail Team


Thank you!

I just noticed that action, and wondered why I hadn't noticed it before!

It worked perfectly with the following:

Replace ( with %28 in Variable: DocumentName (Output to Variable: DocumentName )

Replace ) with %29 in Variable: DocumentName (Output to Variable: DocumentName )

Thanks again

Gizmo3k
gizmo3k
 
Posts: 9
Joined: Fri Aug 12, 2016 2:00 pm


Return to Workflow Actions Pack for Office 365

cron