Pdftron replace placeholders loop inside loop

Product:pdftron

Product Version:9.3.0

Please give a brief summary of your issue:


Above image is the document example, and below is the json we are passing
{
“customerDetails”: [
{
“name”: “venkat”,
“purchasedItems”: {
“insert_rows”:[[“paste”,“10”,“04/08/2022”],[“brush”,“5”,“04/08/2022”]]
}
}
]
}

but in the pdf purchasedItems is not replacing

expected response

can someone please guide me, how to replace the purchasedItems placeholder.

Many thanks.

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Provided information not reaching my requirement

Hi,

It appears you have structured the loop incorrectly. Please refer to the following page:

If that doesn’t solve your issue, please make sure that both sides of the table have the same number of rows, i.e. repeat the customer name “Venkat” for each row of “Items Purchased”.

Please let me know how this works for you, and if you have any further questions.

Hi @kmirsalehi ,
I had restructured the table and it’s working fine. Now I have one more requirement.

If i pass the table like below through word document,


and i am passing the below json for replacing the fields,
{
“address”: [
{
“name”: “Florida”,
“code”: “FL”
},{
“name”: “Illinois”,
“code”: “IL”
}
]
}

Now my requirement here is, how can i achieve the serial number to be incremented for every row. like 1,2,3,4…

Below is the expected table after converting to pdf,

Please let me know if it is possible or not while converting. ASAP.
Many thanks.

Hi,

You can simply edit the table to look like:

and change the json to:
{
"address": [
{
"code": "FL",
"name": "Florida",
"number": "1."
},
{
"code": "IL",
"name": "Illinois",
"number": "2."
}
]
}

(One key thing to note is that I use ASCII quotes "" rather than the Typograhic quotes you used in your example.)

Thanks @kmirsalehi. I have one more requirement.
I am providing json string like below,
{
“address”: [
{
“name”: “Florida”,
“code”: “FL”
},{
“name”: “Illinois”,
“code”: “IL”
}
]
}
where address field is having multiple objects, while converting from word to pdf document. I want to print only first object in table. Is it possible. Samples providing below,
Input file,

Expected Output,

Many thanks.

You would need to simply cut your JSON input so it only includes the first entry. You can not only display the first item when your JSON is passing in multiple items.