The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Flow Custom Action Output Not Working Correctly

Casey23
Tera Guru

I created a custom action to use in a flow. Basically what it does is look at a system property containing usernames in a CSV format. (ex. username1,username2,username2) It can be used for other types of system properties in that format, I just happen to be working with one that has usernames. 

 

Inputs:

Casey23_0-1756318692169.png

 

Script step:

Casey23_1-1756318733769.png

Casey23_2-1756318784308.png

 

Code snippet for easy reading:

(function execute(inputs, outputs) {
    var raw = inputs.system_property || '';
    gs.log("CSV Parser - Raw Input: [" + raw + "]", "CSVParser");
    var parts = raw.split(',');
    var cleaned = [];
    
    for (var i = 0; i < parts.length; i++) {
        var val = parts[i].trim();
        if (val) {
            cleaned.push(val);
        }
    }
    gs.log("CSV Parser - Cleaned Array: [" + cleaned.join('|') + "]", "CSVParser");
    outputs.array = cleaned;
})(inputs, outputs);

 

In the log statement in the script, I can see that I'm getting the proper usernames when the action executes. However, in my flow, something isn't translating. I added a log step and added the output variable "Array" in the message, but it shows up blank.

 

Log action in my flow:

Casey23_3-1756319034426.png

 

System log:

Casey23_4-1756319065096.png

 

What am I missing here? I set this up similar to another custom action I have, granted that one is a string instead of an array.string, but I can't seem to figure out why this isn't working correctly.

 

TIA

1 ACCEPTED SOLUTION

Casey23
Tera Guru

I ended up comparing to another custom action in the system, and it looks like adding that Array pill to the Outputs section of action now shows it in the logs.

Casey23_0-1756321529395.png

 

View solution in original post

1 REPLY 1

Casey23
Tera Guru

I ended up comparing to another custom action in the system, and it looks like adding that Array pill to the Outputs section of action now shows it in the logs.

Casey23_0-1756321529395.png