Shoheb_IbaaBoss
Tera Guru

Hi,

Try below approach:

 

<!DOCTYPE html>
<html>
<head>
<title>Document Template</title>
</head>
<body>
<h1>Document Template</h1>

<!-- Your HTML content here -->

<script>
// Assuming your document template is associated with a particular table, let's say 'incident'
var gr = new GlideRecord('incident');

// Apply a filter based on conditions from the Document Block Content
gr.addQuery('your_condition_field', 'your_condition_value');
gr.addQuery('additional_condition_field', 'additional_condition_value');
// Add more conditions as needed

gr.query();

while (gr.next()) {
// Access fields and perform calculations
var fieldValue = gr.getValue('your_field_name');
// Perform your calculations here based on the field values

// Output the calculated values or use them as needed in your template
document.write('<p>Calculated value for ' + gr.getValue('number') + ': ' + calculatedValue + '</p>');
}
</script>
</body>
</html>

 

Regards,

Shoheb