Create Excel from CSV Text
Audience:
Low-code EngineersSkill Prerequisites:
Actions,Tokens
Turns CSV text into an Excel file (.xlsx) in a portal folder. Each line of the text becomes a row, and each value becomes a cell. The file's URL, path and a download link can be saved as tokens.
The text can be typed in the action, or come from tokens, for example CSV built by Create CSV from List or returned by an API.
This action requires the Excel feature package (EXGEN) to be licensed.
Typical Use Cases
- Convert CSV returned by an API or a report service into an Excel file
- Build a small Excel file from text and tokens, for example a one-row summary
- Turn the CSV text created by Create CSV from List into a workbook with formulas or a password
Don't use it to
- Write a list to Excel. Use Create Excel from List, which handles columns and values for you.
- Export a query result. Use Create Excel from SQL query instead.
- Convert CSV that has quoted values with the separator or line breaks inside them. The text is split without reading quotes. See How the text is read.
- Read CSV into a list. Use Create List from a CSV source instead.
- Send the file to the browser. This action only creates it. See Delivering the file.
Related Actions
| Action Name | Description |
|---|---|
| Create CSV from List | Writes a list as CSV text in a token or a file. |
| Create Excel from List | Writes a list to an Excel file. |
| Create Excel from SQL query | Writes the result of a query to an Excel file. |
| Server Request | Calls an API, for example one that returns CSV. |
| Send Email | Sends the file as an attachment. |
| Redirect to URL | Sends the user to the file's download link. |
Input Parameter Reference
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| Pattern | The file name, without the extension, for example Report-[DateTime:Now|yyyyMMdd]. .xlsx is always added. Leave empty for a random name. | Yes | empty string | No |
| Field Separator | The character between values: comma, semicolon, tab, pipe or colon. In expression mode, you can pass the name, for example semicolon, or the character itself, for example ;. Tab only works by name. Anything else is treated as a comma. | Yes | empty (comma) | No |
| Handle Duplicates | What happens if a file with the same name already exists in the folder. Rename adds a unique suffix to the new file's name. Overwrite replaces the existing file. | No | Rename | No |
| Text | The CSV text, for example [ReportCsv]. One line per row. | Yes | empty string | No |
| Use excel formulas | Writes values that start with = as formulas, for example =SUM(B2:B10). See Cell values. | No | false | No |
| File Password | A password needed to open the file. Leave empty for no password. | Yes | empty string | No |
| Worksheet Password | Protects the sheet, so users can see the data but not change it without the password. Leave empty for no protection. | Yes | empty string | No |
| Folder | The portal folder to save the file in. Select a folder, or in expression mode enter a folder path relative to the portal root, for example Exports/Reports. Missing folders are created. | Yes | none selected | Yes |
| Disable Force Download | By default, the LinkClick URL makes the browser download the file. Turn this on to let the browser open it instead, if it can. Only affects the Store LinkClick Url token. | No | false | No |
Output Parameters Reference
Each output is optional. Enter a token name in the ones you need.
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| Store Absolute URL | Receives the file's absolute URL, for example https://example.com/Portals/0/Exports/Report.xlsx. | No | empty string | No |
| Store Relative URL | Receives the file's URL relative to the site root, for example /Portals/0/Exports/Report.xlsx. | No | empty string | No |
| Store Physical Path | Receives the file's physical path on the server. | No | empty string | No |
| Store LinkClick Url | Receives a LinkClick URL for the file, for example /LinkClick.aspx?fileticket=.... | No | empty string | No |
How the text is read
- The text is split into rows at each line break, and each row is split into cells at each separator.
- Quotes aren't treated specially. A value like
"Smith, John"is split into two cells,"SmithandJohn"(with a leading space), and the quotes stay in the cells. Pick a separator that doesn't appear in your values. - Spaces around values are kept.
- With Windows line endings, the last cell of each row can keep a hidden carriage return character. Use plain line breaks when you build the text yourself.
- The first line isn't treated as a header. It's written like any other row.
Cell values
The workbook has one sheet, named Sheet1. Each value is written like this:
| Value | Written as |
|---|---|
Starts with =, and Use excel formulas is on | A formula. Formulas are calculated before the file is saved. |
Starts with '= | Text, with the ' removed, for example =Not a formula. Use this to write text that starts with =. |
A whole number, for example 42 | A number |
A decimal number, for example 19.99 | A number. The server's number format decides which decimal separator is recognized. |
Starts with 0 and has no decimal point, for example 00123, 0721555123 or 0 itself | Text, so leading zeros are kept. 0.5 is still a number. |
| Anything else, including dates | Text |
Delivering the file
The action saves the file but doesn't send it to the user. To deliver it:
- Redirect the user to the Store LinkClick Url token with Redirect to URL
- Attach it to an email with Send Email, using the file's URL in Attach from Token
- Show a link to the file in a message or a page
Considerations
- Allowed file extensions. The action adds
xlsxto the host's list of allowed file extensions if it isn't there. - Don't add the extension to Pattern.
Report.xlsxbecomesReport.xlsx.xlsx. Characters that aren't allowed in file names make the action fail. - Tokens in the text. Tokens are replaced before the text is split. If a token's value contains the separator or a line break, it adds cells or rows.
- Folder access. The file is saved with the folder's permissions. Choose a folder that the users who download the file can read, and keep private data out of public folders.
- Old files. Each run creates a new file unless Handle Duplicates is
Overwrite. Clean up old files, for example with Delete File.
Examples
To understand how to use the below examples, please see Running Examples.
1. Create a summary sheet with a total
This action writes a small semicolon-separated table to Exports/Summary-<date>.xlsx. The last row adds up the amounts with a formula. The LinkClick URL is saved in the SummaryFileUrl token.
{
"Title": "Create Excel from CSV Text",
"ActionType": "ExcelFromText",
"Description": "Create the monthly summary",
"Parameters": {
"Pattern": "Summary-[DateTime:Now|yyyyMMdd]",
"FieldSeparator": {
"Expression": "",
"Value": "semicolon",
"IsExpression": false,
"Parameters": {}
},
"Duplicates": "Overwrite",
"TextArea": "Region;Amount\nNorth;[NorthTotal]\nSouth;[SouthTotal]\nTotal;=SUM(B2:B3)",
"UseFormulas": true,
"FilePassword": "",
"WorksheetPassword": "",
"Folder": {
"Expression": "Exports",
"Value": "",
"IsExpression": true,
"Parameters": {}
},
"StoreLinkClick": "SummaryFileUrl",
"DisableForceDownload": false
}
}
2. Convert CSV from an API into a read-only workbook
This action converts the tab-separated text in the [ApiResponse] token, for example saved by an earlier Server Request, into a file with a random name in the Imports folder. The sheet is protected with the password in [SheetPassword]. The file's relative URL is saved in the ImportFileUrl token.
{
"Title": "Create Excel from CSV Text",
"ActionType": "ExcelFromText",
"Description": "Convert the API export",
"Parameters": {
"Pattern": "",
"FieldSeparator": {
"Expression": "",
"Value": "tab",
"IsExpression": false,
"Parameters": {}
},
"Duplicates": "Rename",
"TextArea": "[ApiResponse]",
"UseFormulas": false,
"WorksheetPassword": "[SheetPassword]",
"Folder": {
"Expression": "Imports",
"Value": "",
"IsExpression": true,
"Parameters": {}
},
"StoreRelativeURL": "ImportFileUrl"
}
}
Revised 09/26/2026