# How to return from Parse Cloud Function in Node.js

**URL:** <https://community.parseplatform.org/t/how-to-return-from-parse-cloud-function-in-node-js/2303>\
**Category:** ParseSwift SDK\
**Created:** [December 16, 2021, 8:29pm UTC](https://community.parseplatform.org/t/how-to-return-from-parse-cloud-function-in-node-js/2303 "2021-12-16T20:29:43Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![cbaker6](https://community.parseplatform.org/user_avatar/community.parseplatform.org/cbaker6/32/114_2.png) [@cbaker6](https://community.parseplatform.org/u/cbaker6)\
**Post date:** [December 17, 2021, 9:34pm UTC](https://community.parseplatform.org/t/how-to-return-from-parse-cloud-function-in-node-js/2303/11 "2021-12-17T21:34:47Z")

</div>

> Is there a way to modify the arguments property so that I can use a [String : Any]?

No, `Any` isn’t `Encodable`, this only works with types that conform to the `Encodable` protocol. The dictionary for an argument was just an example. Your arguments can be separated into multiple properties of your cloud `struct`:

```swift
struct Cloud: ParseCloud {
  typealias ReturnType = EmailType
  var functionJobName: String
  var argument1: String // Required parameter to your cloud function, `argument1` should match the name of your cloud function parameter. 
  var argument2: Int? // Optional parameter to your cloud function, `argument2` should match the name of your cloud function parameter. 
  // You can have as many parameters as your cloud function has
}

```

> Can I have the arguments be a struct that is Encodable?

If you want something similar to `Any`, you can add the [AnyCodable](https://github.com/Flight-School/AnyCodable) package via SPM and use type `AnyEncodable`. See more [here](https://github.com/parse-community/Parse-Swift/pull/127#issue-866870311) and [here](https://github.com/parse-community/Parse-Swift/issues/141#issue-890290238). So it may look like:

```swift
struct Cloud: ParseCloud {
  typealias ReturnType = EmailType
  var functionJobName: String
  var argument1: String // Required parameter to your cloud function, `argument1` should match the name of your cloud function parameter. 
  var argument2: Int? // Optional parameter to your cloud function, `argument2` should match the name of your cloud function parameter. 
  var argument3: AnyEncodable // Required parameter to your cloud function, `argument3` should match the name of your cloud function parameter. 
  // You can have as many parameters as your cloud function has
}

```

You can also do this with a mixed dictionary. Though I prefer the aforementioned methods as opposed to putting everything in a dictionary:

```swift
struct Cloud: ParseCloud {
  typealias ReturnType = EmailType
  var functionJobName: String
  var arguments: [String: AnyEncodable] 
}

```

---

_[View the full topic](https://community.parseplatform.org/t/how-to-return-from-parse-cloud-function-in-node-js/2303)._
