How to show persistent data in Formit action/return page?

I’m trying to output a json after submitting to formit
I have an input field named “file” and would like to return the name after submitting the form
it returns empty with the code below but in the email that get’s sent the name of the file is there.
what do I need to change in the code below?

[[!FormIt?
       &hooks=`spam,email`
       &emailTpl=`product_fd_email_tpl`
       &emailTo=`jeremiah@thefutureforward.com`
       &emailFrom=`jeremiah@thefutureforward.com`
       &emailSubject=`Request for 3 Part Guide Spec`
       &validate=`nospam:blank,
          full-name:required,
          email:email:required,
          phone:required`
        &successMessage=`success`
    ]]
    {
        "status": "[[+fi.successMessage]]",
        "error": "[[!+fi.validation_error_message:notempty=`[[!+fi.validation_error_message:striptags]]`]]",
        "file": "[[!+fi.file]]"
    }

How are you currently handling the file submission and upload as it doesn’t look like you currently have the necessary provisions in place. In either case I think you’ll need to write a custom hook to handle the file and return a response. I’ll go ahead and assume you want a JSON response as you intend to submit the files via AJAX? There is an AJAX extra for formit that may suit your purpose.

http://jako.github.io/AjaxUpload/

hi LK!
the “file” is just actually a text string with the url of the file in the server. what we’re actually trying to do is return that “string” that was submitted to the form.

Not really understand your question here but the values you can return easily with a custom hook I guess? Just read the value from your uploaded file.

https://docs.modx.com/extras/revo/formit/formit.tutorials-and-examples/formit.examples.custom-hook

Hi guys. Fixed this with FormItRetriever.