Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

How to remove spacing between hyphen in Adobe Campaign

Avatar

Avatar
Validate 10
Level 3
jael91407431
Level 3

Likes

13 likes

Total Posts

46 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 3
jael91407431
Level 3

Likes

13 likes

Total Posts

46 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
jael91407431
Level 3

02-10-2017

Hi,

We create a delivery that contains two data fields concatenated by a hyphen:

s.png

...and when you click on link to the landing page, ("Your Offer"), it brings you to a landing page whose URL address contains the concatenated data fields, "80699361-A07071.htm" but the problem is that the hyphen (" -") that combines the two data fields creates an extra spacing in the URL address: "0699361%20-%20A07071.htm" thereby throwing a 401 page not found error since it is the incorrect URL address.

How do we eliminate the extra spacing surrounding the hyphen so that the extra spacing is removed from the URL address in the dynamic content field that generates the two data fields?:

s.png

Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct Reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct Reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile
Jean-Serge_Biro
MVP

03-10-2017

Hi Jael,

Please write something like this in the Javascript activity of your workflow, or in the Script activity of your delivery in your workflow:

logInfo("field1: #" + vars.field1 + "#");

logInfo("field2: #" + vars.field2 + "#");

then check the logs.

(of course replace vars.field1/2  by your own data element).


You should notice if you get extra space before the end # sign, so it would mean in your data source.
Otherwise, it means that it is the html code that you put in your delivery content that is responsible for your extra space. Please provide the part of hmtl + Javascript code you wrote in the delivery body for that personalisation.

In any cases, you can rid off the extra spaces using standard Javascript function trim():

var str = "       Hello World       ";
logInfo("string without extra spaces : #" + str.trim() + "#");

Regards
JS

Answers (4)

Answers (4)

Avatar

Avatar
Give Back 50
Level 10
florentlb
Level 10

Likes

237 likes

Total Posts

1,109 posts

Correct Reply

239 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 200
View profile

Avatar
Give Back 50
Level 10
florentlb
Level 10

Likes

237 likes

Total Posts

1,109 posts

Correct Reply

239 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 200
View profile
florentlb
Level 10

11-10-2017

Hi Jae

Could you resolve your issue?

Let us know,

Florent

Avatar

Avatar
Validate 10
Level 3
jael91407431
Level 3

Likes

13 likes

Total Posts

46 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 3
jael91407431
Level 3

Likes

13 likes

Total Posts

46 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
jael91407431
Level 3

03-10-2017

Excellent! Jean_Serge!

I will implement your recommendations, and await the results.

Thank you so much as always!

Sincerely,

Jae

Avatar

Avatar
Validate 10
Level 3
jael91407431
Level 3

Likes

13 likes

Total Posts

46 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 3
jael91407431
Level 3

Likes

13 likes

Total Posts

46 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
jael91407431
Level 3

02-10-2017

Hi Jean_Serge Biron,

Thank you for the quick reply. How do I obtain the logInfo of these two fields content?

Avatar

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct Reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct Reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile
Jean-Serge_Biro
MVP

02-10-2017

Hi Jael,

Please may you share the Javascript and html personalisation code for the 2 data fields inserted ?
I guess this is more an html effect than Javascript personalisation matter.

But may you also provide the result of logInfo of these 2 fields content, please do it in a manner that we could see it same way.
(in order to check if the fields content extra space or not)

Regards.
J-Serge