Hi,
We create a delivery that contains two data fields concatenated by a hyphen:
...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?:
Thank you.
Solved! Go to Solution.
Views
Replies
Total Likes
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
Views
Replies
Total Likes
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
Views
Replies
Total Likes
Hi Jean_Serge Biron,
Thank you for the quick reply. How do I obtain the logInfo of these two fields content?
Views
Replies
Total Likes
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
Views
Replies
Total Likes
Excellent! Jean_Serge!
I will implement your recommendations, and await the results.
Thank you so much as always!
Sincerely,
Jae
Views
Replies
Total Likes
Hi Jae
Could you resolve your issue?
Let us know,
Florent
Views
Replies
Total Likes
Views
Likes
Replies