# Multiple files as environment variables

**URL:** <https://forum.serverless.com/t/multiple-files-as-environment-variables/10963>\
**Category:** Serverless Framework\
**Tags:** google, variables\
**Created:** [April 1, 2020, 1:26pm UTC](https://forum.serverless.com/t/multiple-files-as-environment-variables/10963 "2020-04-01T13:26:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trowsing](https://avatars.discourse-cdn.com/v4/letter/t/9f8e36/32.png) [@Trowsing](https://forum.serverless.com/u/Trowsing)\
**Post date:** [April 1, 2020, 1:26pm UTC](https://forum.serverless.com/t/multiple-files-as-environment-variables/10963/1 "2020-04-01T13:26:29Z")

</div>

I have two JSON files containing some values that I’d like to set as environment variables.

The current syntax according to the documentation allows only one reference to a file:

```
functions:
  great_function:
    handler: main
    events:
      - http: path
    environment: ${file(credentials/config.json)}

```

What I’d like to do is to reference multiple files as environment variables:

```
environment:
  - ${file(credentials/config.json)}
  - ${file(credentials/keys.json)}

```

When I tried this got a a type error, so my current solution is to set one file at the _function_ level and the other at the _provider_ level, which is working but I don’t think it’s a great solution.

Is it possible to reference both files at the function level?

---

<div class="post-metadata">

**Author:** ![dhauihn](https://avatars.discourse-cdn.com/v4/letter/d/ad7895/32.png) [@dhauihn](https://forum.serverless.com/u/dhauihn)\
**Post date:** [December 1, 2022, 6:16pm UTC](https://forum.serverless.com/t/multiple-files-as-environment-variables/10963/2 "2022-12-01T18:16:30Z")

</div>

I also with this problem, any solution to import two files in provider.environment ?
