Join string issue - additional separator at end of string

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 u[/u] (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 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

Hi,
Thank you for your message.

You can try to use “Replace” action for your task.

Best regards
Evgeniy Kovalev
Plumsail Team

[quote=“Evgeniy Kovalev”]Hi,
Thank you for your message.

You can try to use “Replace” action for your task.

Best regards
Evgeniy Kovalev
Plumsail Team[/quote]

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