PureSourceCode ★★★★★ (2) ← Back
9 products ✉ Contact flnk.it
PureSourceCode
PSC.Survey.Shared.Imports.CSV

PSC.Survey.Shared.Imports.CSV

£25.00
📦 Digital download

CSV Importer for Survey

Bulk-import answer sets into a Survey form from a CSV file. Use cases: pre-populate surveys from a third-party system, migrate legacy data, bulk-edit in Excel then upload, seed test data.

Features

  • Auto-generate a CSV template from any Form — columns match the element naming convention (txt_1, rdb_2, chk_3, …)
  • Typed mapping — knows how to parse each element type: plain strings for text, integer values for radio/NPS/Likert/Rating, comma-separated lists for multi-select checkboxes / dropdowns / image pickers, matrix coordinates (e.g. row:col) for matrix questions
  • Validates against the form schema — unknown columns flagged, required fields enforced, out-of-range values rejected, helpful error messages per row
  • Continue-on-error mode — imports as much as possible and returns a report of failures, or fails fast by default
  • Configurable delimiter — comma, pipe, semicolon, tab, or any single character
  • Handles headers-first and headers-inline layouts
  • Returns typed ImportReturn — count of successes, structured per-row errors, parsed List<ElementValue> ready to bind to the runtime component

What's included

  • Compiled NuGet package (PSC.Survey.Shared.Imports.CSV) targeting netstandard2.1 (usable from any .NET 6+ project, not just Blazor)
  • Full README with examples for each element type and a recipe for shipping an "Import from CSV" page in your Blazor app
  • Demo page in SurveyBlazorUI/importCSV — template download, upload, validation summary, and preview of imported values
  • LICENCE.md (one developer, annual commercial licence, unlimited end users, no redistribution)

Add to your project

dotnet add package PSC.Survey.Shared.Imports.CSV
using PSC.Survey.Shared.Imports.CSV;

var importer = new CSVImport { Delimiter = "|", ContinueOnError = true };
var result = importer.ImportData(csvText, form);

foreach (var row in result.Rows)
    if (row.Success)
        SaveAnswers(row.Values);
    else
        LogError(row.RowIndex, row.Errors);

And the template generator:

string template = CSVGenerator.GetColumnsTemplate(form);
// => e.g. "txt_1|txt_2|rdb_3|chk_4|…"

Requirements

  • .NET 6 / 8 / 10 (netstandard2.1)
  • PSC.Survey.Shared (models) — included as a NuGet dependency

Pair with

  • Survey runtime — render the form that the CSV populates
  • Excel importer — same API, .xlsx instead of text
£0.00
Powered by flnk.it