# Switch of resultType with makeParameter

**URL:** <https://connect.superhuman.com/t/switch-of-resulttype-with-makeparameter/29308>\
**Category:** Making Packs\
**Created:** [March 13, 2022, 8:32pm UTC](https://connect.superhuman.com/t/switch-of-resulttype-with-makeparameter/29308 "2022-03-13T20:32:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![j.b\_o](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/j.b_o/32/20739_2.png) [@j.b\_o](https://connect.superhuman.com/u/j.b_o)\
**Post date:** [March 13, 2022, 8:32pm UTC](https://connect.superhuman.com/t/switch-of-resulttype-with-makeparameter/29308/1 "2022-03-13T20:32:23Z")

</div>

Hello,

In order to limit the number of formula in a pack, i’m considering to use an additional parameter in a formula.

For example:

1. Reservation(id,info) → Return all information for a reservation with the id, whose the guests
2. Reservation(id,guests) → Return a list of the guests in the reservation with the id

In case 1, i return an object as a resultType. Therefore in case 2, i return an array.

Is it possible to make it works with a parameter?  
Or, is it advised to use 2 separates formulas?  
Exemple : ReservationInfo(id) and ReservationGuests(id)

Thank you in advance for the help.

---

<div class="post-metadata">

**Author:** ![Eric\_Koleda](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/eric_koleda/32/50286_2.png) [@Eric\_Koleda](https://connect.superhuman.com/u/Eric_Koleda)\
**Post date:** [March 14, 2022, 2:38am UTC](https://connect.superhuman.com/t/switch-of-resulttype-with-makeparameter/29308/2 "2022-03-14T02:38:37Z")

</div>

Hi @j.b_o - Unfortunately it isn’t possible to change the return type of a formula based on it’s value. In a case like this I think two different formulas is the best approach. It solves the return type issue, but also helps with doscoverability. Descriptive formula names makes it clear what functionality is available, and having a few related formulas isn’t a bad thing.

---

<div class="post-metadata">

**Author:** ![j.b\_o](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/j.b_o/32/20739_2.png) [@j.b\_o](https://connect.superhuman.com/u/j.b_o)\
**Post date:** [March 14, 2022, 8:29pm UTC](https://connect.superhuman.com/t/switch-of-resulttype-with-makeparameter/29308/3 "2022-03-14T20:29:15Z")

</div>

Thank you @Eric_Koleda for the answer.
