Dynamic args in custom async function

Posted by: lpagliaro on 3 November 2021, 2:02 pm EST

    • Post Options:
    • Link

    Posted 3 November 2021, 2:02 pm EST

    Hi!! Is it possible to define an async function with a variable amount of arguments? Currently we have a custom formula that needs to receive some filters, which can be variable and with different names. So we are using one of the arguments to send this data like:

    =DATA("123", "456", "{ 'filter1'; 'bla', 'filter2': 'some value' }")
    

    And then we parse this object. But this is not very user friendly. Is the are better approach to handle this?

    Thanks.

    Regards.

  • Posted 4 November 2021, 4:20 pm EST

    Hello,

    Our team is currently looking into your question, I will provide further feedback once more information is made available.

    The internal tracking ID for this is SJS-10663

    Best,

    Mackenzie

  • Posted 8 November 2021, 5:46 pm EST

    Hello,

    I have an update on this, when it comes to a custom function having a variable amount of arguments, our team shared that you can implement these different conditions in the same manner as you would the IFS function: https://support.microsoft.com/en-us/office/ifs-function-36329a26-37b2-467c-972b-4a39bd951d45.

    You can define your custom function like so, no longer needing to parsing through the object:

    =DATA(value1, value2, filter1, filterValue, filter2, filterValue…)

    Note, that when defining your custom function you should set minArgs to 2 and maxArgs to 256.

    Let me know if you have any questions!

    Best,

    Mackenzie

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels