Task for High Amount
What does this script do?
Trigger
Full Script
# Read total amount from the document
total = get_field_value(document_data, "total_amount", "0")
try:
if float(total) > 100000:
# Find the Finance Approval group by name
finance_group = get_group_by_name(org_id, "Finance Approval")
# Create an approval task
create_document_task(
user,
document_data,
title="Amount > 100,000 - Approval required",
description=f"Total amount: {total}",
priority="HIGH",
assigned_to_user_id=None,
assigned_to_group_id=str(finance_group.id) if finance_group else None,
send_email=True
)
except ValueError:
passStep-by-Step Explanation
Functions Used
Last updated
Was this helpful?