Skip to main content
Version: 1.28 (Current)

Create Excel from CSV Text

Audience: Low-code Engineers

Skill 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.

note

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​

Action NameDescription
Create CSV from ListWrites a list as CSV text in a token or a file.
Create Excel from ListWrites a list to an Excel file.
Create Excel from SQL queryWrites the result of a query to an Excel file.
Server RequestCalls an API, for example one that returns CSV.
Send EmailSends the file as an attachment.
Redirect to URLSends the user to the file's download link.

Input Parameter Reference​

ParameterDescriptionSupports TokensDefaultRequired
PatternThe file name, without the extension, for example Report-[DateTime:Now|yyyyMMdd]. .xlsx is always added. Leave empty for a random name.Yesempty stringNo
Field SeparatorThe 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.Yesempty (comma)No
Handle DuplicatesWhat 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.NoRenameNo
TextThe CSV text, for example [ReportCsv]. One line per row.Yesempty stringNo
Use excel formulasWrites values that start with = as formulas, for example =SUM(B2:B10). See Cell values.NofalseNo
File PasswordA password needed to open the file. Leave empty for no password.Yesempty stringNo
Worksheet PasswordProtects the sheet, so users can see the data but not change it without the password. Leave empty for no protection.Yesempty stringNo
FolderThe 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.Yesnone selectedYes
Disable Force DownloadBy 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.NofalseNo

Output Parameters Reference​

Each output is optional. Enter a token name in the ones you need.

ParameterDescriptionSupports TokensDefaultRequired
Store Absolute URLReceives the file's absolute URL, for example https://example.com/Portals/0/Exports/Report.xlsx.Noempty stringNo
Store Relative URLReceives the file's URL relative to the site root, for example /Portals/0/Exports/Report.xlsx.Noempty stringNo
Store Physical PathReceives the file's physical path on the server.Noempty stringNo
Store LinkClick UrlReceives a LinkClick URL for the file, for example /LinkClick.aspx?fileticket=....Noempty stringNo

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, "Smith and John" (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:

ValueWritten as
Starts with =, and Use excel formulas is onA 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 42A number
A decimal number, for example 19.99A 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 itselfText, so leading zeros are kept. 0.5 is still a number.
Anything else, including datesText

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 xlsx to the host's list of allowed file extensions if it isn't there.
  • Don't add the extension to Pattern. Report.xlsx becomes Report.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​

tip

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