cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

How to get each elements of an array

Hi All,

 

I have the following in an array:

[
" </div>",
" <div class=\"a-row\">",
"<div class=\"a-section aok-relative s-image-square-aspect\">",
" ",
" ",
" alt=\"Sportscar-Buy\"",

]

Here how to loop through each line to get the "Sportscar-Buy" from the html in that array?

from the line alt I need to extract that text alone?

3 REPLIES 3
Super User II
Super User II

@ThreeCool 

Hi there.  So, your array looks like html so I'm wondering where it came from and if it might be easier to work with that in its original format?

 

But, to answer your question I used a split() function like this one to parse out the data you want (swap out the bold bits with the dynamic value of your 'array':

 

split(split(outputs('Sample_Array'),'alt=\"')[1],'\""')[0]

 

Here's a video on the function that will get you started on how it works:

 

 

Keep us posted.

-Ed

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

Super User
Super User

Hello @ThreeCool 

No need to loop through the array at first - use a Filter array instead to filter out items with "alt=" - so you only have to work with them.

Now loop through each array item from the Filter array and extract the text using an expression - nearly like @edgonzales  wrote you.

Extracting the text using expression:

split(item(),'"')[1]

Hope this helps you on the way. Kind regards, John

 

Thank you so much.Really helpful

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (63,823)