Option to Append the data returned from a subroutine to a variable

I'm using KM 11.0.4 on Sequoia 15.7.1.

In the Execute Subroutine Action, a field is provided to save the returned result to a variable:

I'm working on a macro that needs to append the returned data to an existing variable, so each time it is called I save the returned data to a temporary variable and append that to my "main" variable.

I'd like to request an enhancement in a future version to allow the returned data from a subroutine to be appended directly to a variable (in a similar way to the options for returned data from the Execute a Shell Script action).

Just append or also prepend?

Do you want it to ensure carriage returns between values?

Definitely not, that's a user responsibility to add or exclude them as needed.

My current use case is append, but a prepend could conceivably be useful. The list of options on the Execute a Shell Script action provides a list of other possibilities, but I don't think "asynchronously" would be relevant to the subroutine case:

I don’t think your idea is bad at all, but The Architect has several requirements before he adds new features. At best he will just add this idea for future consideration. The main issue is that it’s easy to work around this problem.

Of course, it's up to Peter to either say "no" or to add it to the list of possible enhancements. It's not a problem, just one of those nice to haves that would simplify the macro by removing an action and reduce a little friction point when writing them.

Understood. And agreed. But I would MUCH rather see subroutines also come in a FUNCTION form, so I can create expressions that include functions of my choosing. This would save me a LOT of effort.

Noted.

2 Likes