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

Iterating through custom table in Email Attachment

Avatar

Avatar
Validate 1
Level 1
chetanb78587643
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
chetanb78587643
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
chetanb78587643
Level 1

12-10-2018

Hi team,
I need to create a logic for dynamic table within a PDF attachment of email delivery .

please let me know of any appropriate approach in this scenario. I went through documentation,however there was no proper approach mentioned for the same. I tried using following script but that didn't work out.

<%=

for (var i = 0; i< customProduct.length; i++){ 

if(customProduct[i].email==targetData.email)) { 

document.write(customProduct[i].email); 

}

%>

Note: link to the documentation

Generating personalized PDF documents

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 25
Level 4
Deb007
Level 4

Likes

48 likes

Total Posts

85 posts

Correct Reply

24 solutions
Top badges earned
Boost 25
Affirm 10
Applaud 5
Give Back 5
Establish
View profile

Avatar
Boost 25
Level 4
Deb007
Level 4

Likes

48 likes

Total Posts

85 posts

Correct Reply

24 solutions
Top badges earned
Boost 25
Affirm 10
Applaud 5
Give Back 5
Establish
View profile
Deb007
Level 4

16-10-2018

Hi Chetan,

Are you trying to do something similar to this?

1597413_pastedImage_0.png

Regards,

Deb

Answers (7)

Answers (7)

Avatar

Avatar
Validate 1
Level 1
chetanb78587643
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
chetanb78587643
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
chetanb78587643
Level 1

16-10-2018

Oh yeah.This works.
Gratitude.

Avatar

Avatar
Validate 1
Level 1
chetanb78587643
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
chetanb78587643
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
chetanb78587643
Level 1

16-10-2018

Hey Deb,
Have tried this query <%customProduct[i].email%> and its rolling perfectly. Even the query <%=customProduct.length%> got me proper results.
What I have observed is that running the whole script is giving me Error. Especially the loop part.
All of the Single statement Codes are working perfect.

Thanks.

Avatar

Avatar
Boost 25
Level 4
Deb007
Level 4

Likes

48 likes

Total Posts

85 posts

Correct Reply

24 solutions
Top badges earned
Boost 25
Affirm 10
Applaud 5
Give Back 5
Establish
View profile

Avatar
Boost 25
Level 4
Deb007
Level 4

Likes

48 likes

Total Posts

85 posts

Correct Reply

24 solutions
Top badges earned
Boost 25
Affirm 10
Applaud 5
Give Back 5
Establish
View profile
Deb007
Level 4

16-10-2018

Hi Chetan,

Please can you try to put "<%customProduct[i].emai%>" instead of "document.write(customProduct[i].emai)" as explained in the following URL and give it a try.

Generating personalized PDF documents

Regards,

Deb

Avatar

Avatar
Validate 1
Level 1
chetanb78587643
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
chetanb78587643
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
chetanb78587643
Level 1

16-10-2018

Hey Deb,Capture3.PNG

Appreciate your help.
Since we were not able to render of send the campaign. I am attaching the preview.

thanks

Avatar

Avatar
Boost 25
Level 4
Deb007
Level 4

Likes

48 likes

Total Posts

85 posts

Correct Reply

24 solutions
Top badges earned
Boost 25
Affirm 10
Applaud 5
Give Back 5
Establish
View profile

Avatar
Boost 25
Level 4
Deb007
Level 4

Likes

48 likes

Total Posts

85 posts

Correct Reply

24 solutions
Top badges earned
Boost 25
Affirm 10
Applaud 5
Give Back 5
Establish
View profile
Deb007
Level 4

16-10-2018

Please can you post the error message.

Regards,

Deb

Avatar

Avatar
Validate 1
Level 1
chetanb78587643
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
chetanb78587643
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
chetanb78587643
Level 1

15-10-2018

Hey Deb,

yeah, I did upload my primary file in open office document format(.odt). FYI I got proper results on using single scripts like <%=customProduct[1].email%>. However on using loop there seems to be some kind of error.

Thanks.

Avatar

Avatar
Boost 25
Level 4
Deb007
Level 4

Likes

48 likes

Total Posts

85 posts

Correct Reply

24 solutions
Top badges earned
Boost 25
Affirm 10
Applaud 5
Give Back 5
Establish
View profile

Avatar
Boost 25
Level 4
Deb007
Level 4

Likes

48 likes

Total Posts

85 posts

Correct Reply

24 solutions
Top badges earned
Boost 25
Affirm 10
Applaud 5
Give Back 5
Establish
View profile
Deb007
Level 4

15-10-2018

Hi Chetan,

Are you using Open Office to create the attachment as mentioned in the documentation?

Regards,

Deb