Most (all?) of the time in NetSuite transaction advanced pdf forms, the "meat" of the content for items on a transaction start with a line such as:
<table class="itemtable"><!-- start items --><#list record.item as item><#if item_index==0>
then it provides the content (usually items) in an html table and finishes the loop with a closing tag of:
</#list><!-- end items -->
When I need to first gather information from the item list but not actually print it out to the pdf, I like to follow the same structure minus the html elements. For your case, I think you want to identify a particular item in a sublist and then if it is present, record the amount for future use elsewhere in the form. Using the above structure, that would be something like this:
<!-- assign variable to hold initial value -->
<#assign item_x_amount = 0>
<!-- populate the amount if the item is present in any row -->
<#list record.item as tmpLine>
<#if (tmpLine.item == "Consulting Services")><#assign item_x_amount = item_x_amount + tmpLine.amount></#if>
</#list>
Then, later on in the code for creating the subtotal table, add in your variable lable and value. Resulting in a transaction that looks like:
![enter image description here](https://i.stack.imgur.com/FGo8E.jpg)
Notes:
- I took the liberty of expanding your request to "the sum of the amounts for a particular item". This also covers your assumption that there will only ever be one matching item on the transaction, but people rarely always follow the rules. If you definitely don't want that behavior, you can change
<#assign item_x_amount = item_x_amount + tmpLine.amount>
to <#assign item_x_amount = tmpLine.amount>
- If the item name changes, this breaks. You did not mention how you were identifying the item in question. It is safer to use some other identifying information about the item (internal ID perhaps) or even better is a transaction line field that flags it as a row to use in this process.
- I formatted the displayed result as currency using
${item_x_amount?string.currency}
Hopefully this helps! I use this technique a lot in NetSuite development.