If you are using a Table you can use the new TableRow tag to the root of your repeating XPath, if not using the old Repeat tags with the same Path will work. For the internal contents you will need your usually Content tags but the XPath will be relative to you TableRow or Repeat tag.
So:
<# <Repeat Select="//Locations_Container/Locations" Optional="true" /> #>
<# <Content Select="./Location_Name" Optional="false" /> #>
<# <EndRepeat/> #>
or
<# <TableRow Select="//Locations_Container/Locations" /> #> in any cell of the table row you want repeated
<# <Content Select="./Location_Name" Optional="false" /> #> in all other cells for content output
Where:
<Locations_Container>
<Locations>
<Location_Name />
</Locations>
</Locations_Container>
I used TableRow syntax and nothing was displayed on the document. Not sure what is wrong here...
here is the xml I am passing
<Account>
<Name>XYZ</Name>
<Contact>
<FirstName>John</FirstName>
<LastName>Mack</LastName>
</Contact>
<Contact>
<FirstName>Robert</FirstName>
<LastName>Chang</LastName>
</Contact>
</Account>
I see extra spaces in your TableRow select.
Also, what exactly are you getting back, nothing as in blank or nothing as in not what you want?
I have one space between TableRow and Select and content comes blank in the document. Content should be populated with First Name and LastName in xml.
Removing the space makes TableRowSelect one word and I get error below.
To be clear I was stating the previous image showed extra spaces in your Select statement, not in the tag.
Finally I am able to generate the table with little tweaks in the definition.
Thanks for your inputs @Zakee Goliak
Great job!
So, it looks like the extra spacing is gone, which I believe is the significant change.
The other change, //Contact, is a more direct pointer to the base of the repeat. I would caution that if in the future you XML structure changes, and Account becomes nested within another Repeat, this will throw an error stating there are more than one node for the requested path.
I understand your point on direct pointer but I was not able to give the xpath using nested nodes. I removed the spaces what you observed but the output was blank.
For now, I don't consider another level of nesting but thats the valid use-case for other workflow.
Another question, I think you might have answer. How can I add conditional logic to render the table? There is possibility that table data is not coming in the xml and tables not to be generated on the document not even a header? You have been helpful so far.
There is a conditional tag. Unlike the current tags you have used this one will require a Match/NotMatch attribute as well as a closing tag. If the select evaluates to the value in Match or not evaluate to the value in NotMatch then the content will be displayed.
<# <Conditional Select="" Match="" /> #>Content to show or hide<# <EndConditional/> #>
<# <Conditional Select="" NotMatch="" /> #>Content to show or hide<# <EndConditional/> #>
Hope this makes sense.
@Zakee Goliak This worked like a charm, thank a lot. Can you guide me to some reference where I can learn how to use these tags, I am sure there are more tags which I might need in future.
file:///C:/Users/ae421/Documents/Andres/FOTOS%20PRIVADAS/Summary%20(2).pdf
https://sandwicheria-tito-santos.negocio.site/
Ok jumping in to this one. I have a document that I've built the repeat conditional format in but how do I add a page break so it does not cut in the middle of the table?
Example I know that 4 sets of data fit perfect, the 5th set of data breaks in the middle and repeats on the next page. So is there a way to create that break so it jumps to then next page without having to create multiple documents if the there are more than 4 call outs in the workflow?
Hey Zakee!
Hello FMA, haha
A way I believe you could solve this matter would be to insert a conditional before the table, since you know where the break is, that would check for the number of rows present. If the conditional evaluates above your tolerance then the page break within will be exposed, this starting the table on a new page.
Thanks Zakee, not sure how to write that but Ill give it a shot
Can't figure it out.. Any help anyone can offer would be appreciated.
The best option I think would be to create a table with just one cell as your outer table and have a table with those rows inside that table. Then, you can set the outer table's properties to not allow the row to break across pages. I assume your repeat tag is around the entire table which would remain the same, but this would probably solve your problem without having to worry about counting how many rows you have and trying to bake in a conditional tag with a page break. Good Luck!