Return string value directly, or reduce list to string if value is a list #1592
-
I'm struggling to get something rather simple to work, I'm afraid. My input is this file: https://gitlab.com/gitlab-com/www-gitlab-com/-/raw/master/data/stages.yml I'm using the following to find out the PM for a certain group, for example for "Geo":
That works fine. However, in the file you'll see that not every I can come up with a version that handles this and returns this list as a comma separated string, but then it stops working for the ones that give a string directly. I can't figure out how to write something that handles both cases. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Easiest way I can think of solving that is to add the
yields:
with join:
yields:
|
Beta Was this translation helpful? Give feedback.
Easiest way I can think of solving that is to add the
.pm
to an empty array. If its a string, you'll have an array with a single string. If it's an array of strings, then it will simple be an array concatenation, and you end up with the array of strings. From there, you can join the string if desired:yields:
with join:
yields: