Skip to main content
Nintex Community Menu Bar

Recycle Item Web request failing on file names with commas and apostrophes

  • June 13, 2019
  • 3 replies
  • 8 views

kmccool
Forum|alt.badge.img+9

Hey everyone,

This post is loosely related to this one: Old post

 

My web call was working great throughout our cleanup project, however, we've just started cleaning the engineering collection and there are multiple items with file name that contain commas and apostrophes. These seem to be messing with the recycle web request.

 

here's and example of the call with the culprit underlined:

http://it/_api/web/getfilebyserverrelativeurl('cust/TechnicalAdvisor/Tom'sFiles/FacilitiesChargeandDamageClaimsProcessInteraction.docx')

I've tried a build string action that puts the URL in quotes so the call doesn't mistake the apostrophe as part of the command but it still isn't working. Call works for all files except those with commas and apostrophes in the file or doc name. ugh.

 

Thanks in advance for the help!

Kassie 

 

 

3 replies

Forum|alt.badge.img+14
  • Scholar
  • June 14, 2019

you need to double single apostrophee character, like

...Tom''sFiles...

 

good practice is as well to encode 'sensitive' characters, like

...Tom%27%27sFiles...

 


kmccool
Forum|alt.badge.img+9
  • Author
  • Scholar
  • June 20, 2019

I tried a replace function to add %27 but yea the request was unencoding it back to a apostrophy. I'll try this double approach and get back to you!

 

Thanks

Kassie


kmccool
Forum|alt.badge.img+9
  • Author
  • Scholar
  • June 27, 2019

Okay, so apostrophes I had to double encode, and commas I only had to single encode.

I used two RegEx actions, one to replace a comma with %2C and the other to replace an apostrophe with %27%27. My web call now works. YAY!

 

Thanks for the assistance @emha!