Switch of resultType with makeParameter

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.

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.

1 Like

Thank you @Eric_Koleda for the answer.