Hi, I have an array like example below. But I need first value and second value and third value sequentially. When I tried for each it is printing differently.
Array example : {‘one’, ‘two’, ‘three’}
I’m getting output when I use for each is:
One
One
Two
One
Two
Three
But I need to assign each time to a variable
And output should be like
One
Two
Three
Pls help
Anil_G
(Anil Gorthi)
July 21, 2023, 2:20pm
2
@Sudheer_Kumar_S
in for loop in argument give {"One","Two","Three"}
and inside loop usecurrentItem
in the log…it would give exactly as you need
cheers
supriya117
(Supriya Allada)
July 21, 2023, 2:22pm
3
@Sudheer_Kumar_S
If you use for each, it will only print one time.
Var = Currentitem.tostring
Check if you are printing the variable two times or one time.
Parvathy
(PS Parvathy)
July 21, 2023, 2:25pm
4
Hi @Sudheer_Kumar_S
input={"One","Two","Three"}
Refer the below Image
Uploaded the workflow xaml for reference
Sequence9.xaml (6.7 KB)
Hope it helps!!
Vikas_M
(Vikas M)
July 21, 2023, 2:27pm
6
You can try putting it in a for each loop with the array as list of items and printing it or you can join it and print it.
Using for Each loop:-
String Join:-
The XAML used:-
Main.xaml (8.0 KB)
Hi everyone… I’m appending that particular array that is why it is taking
Like
One
One two
One two three
Any idea how to take last one as an array and apply the logic you guys mentioned
supriya117
(Supriya Allada)
July 21, 2023, 3:23pm
9
@Sudheer_Kumar_S
If it’s an array try like this:
res = MyArray.Last
If it’s string:
res = MyStr.Split(" ").Reverse()(0)
1 Like
Parvathy
(PS Parvathy)
July 21, 2023, 3:27pm
10
Hi @Sudheer_Kumar_S
Check out the below workflow and hope it meets up your requirement.
Sequence9.xaml (8.6 KB)
Hope it helps!!
Regards,
Thank you Supriya… it’s working now able to keep it in variable
1 Like
system
(system)
Closed
July 24, 2023, 3:41pm
13
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.