---
title: "Auto-Save Each Submission to a JSON file - Convert Forms"
description: "Would you like to automatically save each submission into a JSON file that you can later use and monitor your submissions? This is rather useful if yo"
url: "https://www.tassos.gr/docs/convert-forms/submission-management/automatically-save-each-submission-to-a-json-file"
date: "2026-06-22T12:13:07+00:00"
language: "en-GB"
---

[ Home ](https://www.tassos.gr/index.php?option=com_content&view=category&layout=blog&id=24&Itemid=1088) / [ Convert Forms ](https://www.tassos.gr/index.php?option=com_content&view=category&id=43) / [ Submission Management ](https://www.tassos.gr/index.php?option=com_content&view=category&id=150)

#  Auto-Save Each Submission to a JSON file

Heads up! This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.

Would you like to automatically save each submission into a JSON file that you can later use and monitor your submissions? This is rather useful if you want to import the data into 3rd-party software to edit or even print them. The following PHP snippet will allow you to export each submission into a file.

## [Setup](#setup)

To save the submissions into a file, copy the code shown below and place it into the [PHP Scripts -&gt; After Form Submission](https://www.tassos.gr/joomla-extensions/convert-forms/docs/php-scripts#after_form_submission) area of your form.

 ```
// Enter the file name where your submissions will be saved.
$file_name = 'submissions.txt';

// Do not edit below
$file = JPATH_SITE . '/' . $file_name;

$data = is_file(\Joomla\Filesystem\Path::clean($file)) ? json_decode(file_get_contents($file), true) : [];

if (!is_array($data))
{
    return;
}

// Set the data that will be saved
$save_data = [
	'ID'    => $submission->id,
	'Date'  => $submission->created,
	'Name'  => $submission->params['name'],
	'Email' => $submission->params['email']
];

array_push($data, $save_data);

$data = json_encode($data, JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES);

// Save the file
\Joomla\Filesystem\File::write($file, $data);

```

Note: the submitted data by default are ID, Date, Name and Email. You can save further information by manipulating the *$save\_data* variable above.

 Last updated on Jun 22nd 2026 15:06

## Schema

```json
{
    "@context": "https://schema.org",
    "@type": "BreadcrumbList",
    "itemListElement": [
        {
            "@type": "ListItem",
            "position": 1,
            "name": "Home",
            "item": "https://www.tassos.gr"
        },
        {
            "@type": "ListItem",
            "position": 2,
            "name": "Home",
            "item": "https://www.tassos.gr/docs"
        },
        {
            "@type": "ListItem",
            "position": 3,
            "name": "Convert Forms",
            "item": "https://www.tassos.gr/docs/convert-forms"
        },
        {
            "@type": "ListItem",
            "position": 4,
            "name": "Submission Management",
            "item": "https://www.tassos.gr/docs/convert-forms/submission-management"
        },
        {
            "@type": "ListItem",
            "position": 5,
            "name": "Auto-Save Each Submission to a JSON file",
            "item": "https://www.tassos.gr/docs/convert-forms/submission-management/automatically-save-each-submission-to-a-json-file"
        }
    ]
}
```

```json
{
    "@context": "https://schema.org",
    "@type": "Article",
    "mainEntityOfPage": {
        "@type": "WebPage",
        "@id": "https://www.tassos.gr/docs/convert-forms/submission-management/automatically-save-each-submission-to-a-json-file"
    },
    "headline": "Auto-Save Each Submission to a JSON file",
    "image": {
        "@type": "ImageObject",
        "url": "https://www.tassos.gr/"
    },
    "publisher": {
        "@type": "Organization",
        "name": "Tassos",
        "logo": {
            "@type": "ImageObject",
            "url": "https://www.tassos.gr/https://www.tassos.gr/media/brand/logo-text.png"
        }
    },
    "author": {
        "@type": "Person",
        "name": "Tassos Marinos",
        "url": "https://www.tassos.gr/docs/convert-forms/submission-management/automatically-save-each-submission-to-a-json-file"
    },
    "datePublished": "2020-11-02T19:18:15+02:00",
    "dateCreated": "2020-11-03T10:48:58+02:00",
    "dateModified": "2026-06-22T15:00:04+03:00"
}
```
