Flow subflow - trying to test an input type of Array.String

GoBucks
Mega Sage

I have created a simple subflow with an input type of array.string:

find_real_file.png

Is this type not an array of strings?  Perhaps I'm misunderstanding it or forgetting something obvious. I then have a For each logic action so I can loop through this array of strings:

find_real_file.png

And within the loop I'm simply attempting to print to the log:

find_real_file.png

When I go to test I enter a test value for just one array element:

find_real_file.png

When I look at the runtime value it appears to be null as if I never provided a value for this array element.

find_real_file.png

How can I test the input type of Array.String?

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@GoBucks 

Seems you need to refer this blog for help

Using list collector in Flow Designer 'For Each loop' by converting string into array of string

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

8 REPLIES 8

Linda S
ServiceNow Employee
ServiceNow Employee

define an output....

Well I don't necessarily need an output.  I went ahead and defined one although I'm not setting the output in my example I shared.  What I am unable to do is print the value of this input type (what I think is an array of strings) to the log.  The test doesn't even show that I provided a value at runtime, and I did.  I feel there's something fundamental I'm missing here...

While I see null in my original example, the past few tests I see:

{
    "my_text": {
        "my_text_child0": [
            ""
        ]
    }
}

Again, I provided a value prior to running the test.

MrMuhammad
Giga Sage

Hi,

Your flow looks good. I just tested the same on my side as well and it works. I would suggest deleting the existing input variable and recreating it that might solve this problem. I observe this many times recreation fix these types of issues in flow designer.

find_real_file.png

Hope that helps!

Regards,

Muhammad

Regards,
Muhammad

I executed cache.do and then completely recreated a separate Subflow to test. I once again gave one array element a value and ran the test.  Once again got an empty string even though I entered a value prior to running test:

find_real_file.png

So then I repeated this on a PDI and same result.  Am I do anything wrong with how I'm entering the test value?  Here's the latest test:

find_real_file.png