CSV decision tree template (refund eligibility)

A refund eligibility decision tree built from a CSV export: 25 rows, 12 labelled decisions, four of them three-way, and five separate endings. Shows how Line to and Line text pair up position by position.

Use this template

The CSV that produces this diagram

One row per step. The numbers in Line to are row numbers — that is what draws the connectors, and it is the column most files are missing.

#ShapeBox textLine toLine textHorizontal laneVertical lane
1StartCustomer requests a refund2RequestCustomer
2InputRecord the order number, date and reason3RequestAgent
3DecisionOrder found in the system?5, 4Yes, NoRequestAgent
4DecisionProof of purchase supplied?5, 22Supplied, No reply after two remindersRequestCustomer
5DecisionHow old is the order?7, 6, 21Within 30 days, 31 to 90 days, Over 90 daysEligibilityAgent
6DecisionSupervisor approves the late request?7, 21Approved, DeclinedEligibilitySupervisor
7DecisionIs the item physical or digital?8, 11Physical, DigitalEligibilityAgent
8ProcessBook the return and inspect the item9ConditionAgent
9DecisionWhat condition is the item in?12, 13, 10Unopened, Opened but resaleable, FaultyConditionAgent
10DecisionIs the fault covered by the warranty?14, 21Covered, Customer damageConditionSupervisor
11DecisionHas the digital item been downloaded?12, 13, 15Not accessed, Partly used, Fully consumedConditionAgent
12ProcessCalculate the full refund amount16AdjudicationAgent
13ProcessCalculate the partial refund amount16AdjudicationAgent
14DecisionReplacement or refund?19, 12Replacement, RefundAdjudicationCustomer
15DecisionGoodwill credit within the agent's limit?18, 17Within the limit, Above the limitAdjudicationAgent
16DecisionIs the amount above the agent's approval limit?20, 17At or below the limit, Above the limitApprovalAgent
17DecisionSupervisor approves the payment?20, 18, 21Approved in full, Approved as store credit, DeclinedApprovalSupervisor
18ProcessIssue store credit to the account24SettlementFinance
19ProcessShip the replacement and close the return25SettlementAgent
20ProcessPay the refund to the original payment method23SettlementFinance
21RejectRefund declined, reason recordedSettlementAgent
22EndRequest closed with no replySettlementAgent
23SuccessRefund paid to the original methodSettlementFinance
24SuccessStore credit issuedSettlementFinance
25SuccessReplacement shippedSettlementAgent
#,Shape,Box text,Line to,Line text,Horizontal lane,Vertical lane
1,Start,Customer requests a refund,2,,Request,Customer
2,Input,"Record the order number, date and reason",3,,Request,Agent
3,Decision,Order found in the system?,"5, 4","Yes, No",Request,Agent
4,Decision,Proof of purchase supplied?,"5, 22","Supplied, No reply after two reminders",Request,Customer
5,Decision,How old is the order?,"7, 6, 21","Within 30 days, 31 to 90 days, Over 90 days",Eligibility,Agent
6,Decision,Supervisor approves the late request?,"7, 21","Approved, Declined",Eligibility,Supervisor
7,Decision,Is the item physical or digital?,"8, 11","Physical, Digital",Eligibility,Agent
8,Process,Book the return and inspect the item,9,,Condition,Agent
9,Decision,What condition is the item in?,"12, 13, 10","Unopened, Opened but resaleable, Faulty",Condition,Agent
10,Decision,Is the fault covered by the warranty?,"14, 21","Covered, Customer damage",Condition,Supervisor
11,Decision,Has the digital item been downloaded?,"12, 13, 15","Not accessed, Partly used, Fully consumed",Condition,Agent
12,Process,Calculate the full refund amount,16,,Adjudication,Agent
13,Process,Calculate the partial refund amount,16,,Adjudication,Agent
14,Decision,Replacement or refund?,"19, 12","Replacement, Refund",Adjudication,Customer
15,Decision,Goodwill credit within the agent's limit?,"18, 17","Within the limit, Above the limit",Adjudication,Agent
16,Decision,Is the amount above the agent's approval limit?,"20, 17","At or below the limit, Above the limit",Approval,Agent
17,Decision,Supervisor approves the payment?,"20, 18, 21","Approved in full, Approved as store credit, Declined",Approval,Supervisor
18,Process,Issue store credit to the account,24,,Settlement,Finance
19,Process,Ship the replacement and close the return,25,,Settlement,Agent
20,Process,Pay the refund to the original payment method,23,,Settlement,Finance
21,Reject,"Refund declined, reason recorded",,,Settlement,Agent
22,End,Request closed with no reply,,,Settlement,Agent
23,Success,Refund paid to the original method,,,Settlement,Finance
24,Success,Store credit issued,,,Settlement,Finance
25,Success,Replacement shipped,,,Settlement,Agent

How it works

  1. Export the requests, then keep four columns

    Take the export you already have and rename its headers to Shape, Box text, Line to and Line text. Add Horizontal lane and Vertical lane if you want the depth and the roles drawn as lanes, and Line style only if you want a branch coloured. Everything else in the export can stay where it is: import matches on header names, so column order does not matter and unrecognised columns are carried and ignored rather than rejected.

  2. Make the header row the first line of the file

    Reporting tools often write a title line, a date stamp or a blank row above the headers. A CSV has no concept of a title, so line one is read as the header row whatever it says, and a file whose first line is Report generated 12/03 imports with one column called Report generated 12/03. Open the file in a text editor and delete everything above the headers, plus any trailing blank lines at the bottom, which arrive as empty rows.

  3. Number the rows before you write Line to

    Line to holds positions, not names or ids: 7 means the seventh data row, counting from 1 under the header. Write the whole tree out in the order you want it first, then fill in the numbers. If you sort or reorder the file afterwards, every number in the column still points at a position and now points at the wrong row, and nothing about the file looks wrong. Sorting a CSV of steps is the fastest way to silently rewire a tree.

  4. Pair Line to and Line text one for one

    The two cells are read as two lists and matched by position, so they must have the same number of entries: 7,6,21 with Within 30 days,31 to 90 days,Over 90 days. There are two layers of commas here and only the outer one can be escaped. A field containing a comma is quoted in the file, which is why the box text Record the order number, date and reason is fine; a branch label containing a comma is not rescued by quoting, because the label list is split on commas after the quotes come off. Write Opened but resaleable, never Opened, resaleable.

  5. Put your own numbers into the three thresholds

    Three rows carry a figure this template only guesses at. The age bands on the request are 30 and 90 days; replace them with your published window and with the range a supervisor may still approve. The agent approval limit is a currency amount, not a judgement, and it should sit where the tail of large refunds escalates without turning the supervisor lane into a queue. And partly used needs a definition for digital goods — one download, one lesson watched, one licence key revealed.

  6. Check the delimiter and the encoding before you import

    Look at line one in a plain text editor. Semicolons between the headers mean the file was saved by an application using a European list separator, and read as comma-separated it collapses into a single column. Save it as UTF-8 as well: an export written in a legacy codepage turns £, é and — into replacement characters that then sit inside your box labels, and a UTF-8 byte order mark can attach itself to the first header so that Shape stops matching the Shape column.

Frequently asked questions

How do you write a three-way branch in a CSV?

The same way you write a two-way one, with one more entry in each of the two cells. On row 5 of this chart the Line to cell reads 7,6,21 and the Line text cell reads Within 30 days,31 to 90 days,Over 90 days. The first number pairs with the first label, the second with the second, the third with the third. There is no limit implied by the format and nothing in it assumes yes and no, which matters for a real policy: age bands, item condition and a supervisor's options are rarely binary, and forcing them into nested yes/no diamonds doubles the number of rows without adding a single rule. Four of this chart's twelve decisions have three exits.

What happens if Line to and Line text have different numbers of entries?

The pairing is by position, so a missing label does not leave a gap where it was — it pulls every later label one place forward onto the wrong arrow. Drop the Yes from a three-branch row and the second branch is labelled with what belonged to the first. The reason this is worth checking by hand is that neither cell is malformed on its own: both are ordinary comma-separated text, both survive any CSV parser, and the file gives you no signal at all. Count the commas in the two cells of every decision row before you import, and treat a decision whose arrows are not all labelled as a bug rather than a style choice.

Why does my CSV import as a single column?

Almost always the delimiter. Saving a sheet as CSV uses the list separator configured for the machine's locale, so a file produced on a machine set to a European locale is semicolon-delimited while still being called .csv. Read as comma-separated, each line is one field and you get one very wide column. Open the file in a plain text editor and look at the header line: if the separators are semicolons or tabs, re-export with commas or replace them. Do the same check for the encoding at the same time, because an accented character rendered as a pair of stray symbols in the text editor will be stored exactly that way in your box labels.

Do I have to delete the columns my helpdesk export adds?

No. Import matches header names rather than column positions, so Ticket ID, Assignee, Created at, Channel and anything else in the export are carried through and ignored. Two practical consequences: you do not need to reorder anything before importing, and you can keep the reference data next to the process so a row remains traceable to the ticket it came from. The one thing to check is that you have not accidentally left two columns with the same header, which is easy to do when an export names a column Notes and the sheet already has one.

How is a CSV decision tree different from building the same thing in Excel?

A CSV has no formulas, no sheets, no cell types and no formatting, so nothing in the file can compute a branch or hide a rule in a conditional format. Everything the tree does has to be written literally in Line to and Line text, which is a limitation when you are editing and a benefit when someone else has to read it or diff it in version control. It is also worth remembering what a CSV is for: it is what a system gives you on the way out. Nobody maintains a policy in one. Export it, import it once, and from then on edit the chart and the sheet together rather than round-tripping the text file.

Use this template

Guides that use this template

More in CSV flowchart and diagram templates

More in Process flowchart templates

Browse all CSV flowchart and diagram templates