No internet connection
  1. Home
  2. Macro and Script Help

Is it possible to pull variables from a CSV?

By DJH @DJH
    2022-07-20 18:15:30.615Z

    Hi -

    I'm looking for general advice about the best way to make variables available to a SF script. Is it possible for SF to pull variables from a CSV? Or is there a better way to do the following? -

    I want a project workflow that works like this -

    1 - I fill out a form that inputs basic information about a project. For example:

    • Project name
    • Contact email addresses
    • Web addresses related to the project
    • etc.

    2 - The form results are exported to a CSV and stored in the projects folder.

    3 - Various SF scripts use the CSV to retrieve relevant variables for a given script. For example:

    • Any script that involves using a projects name, like naming a Pro Tools session, naming stems, sending a notification to someone about the project, would pull the projects name from the CSV.
    • A script that involves uploading content would use the appropriate url from the CSV,
    • A script that involves emailing a contact would pull the mail-to address the CSV.
    • etc.

    For the form, I'm thinking of using maybe a saas or Keyboard Maestro or possibly Google Forms. But maybe its possible/better to make a form/app right in soundflow?

    I'm not much of a coder, so I'd maybe shy away from making the form in SF as there seem to be much easier tools for that task - especially considering I'd like to be able to have dropdown options and the ability to tweak the form over time easily. Though if there were significant advantages to keeping it all native to SF, I'd consider it and maybe hire some help.

    Make sense? Is this the best way to think about how to do this - form-to-csv with variables?

    Thanks in advance.

    • 2 replies
    1. I'd recommend using JSON for this instead of CSV, as it's a much more structured storage format.
      It's very easy to read JSON in SF, just use sf.file.readJson. Another great thing with JSON is that it's Javascript's native format for storing variables, so there's no conversion.

      In any event, this would require some coding expertise. It's not currently possible to read variables from a file in a macro.

      1. You could probably build a JSON form here:

        https://jsonforms.io/