cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JimTurner
Level: Powered On

How to Retrieve Data from Array with no named fields

Hi  I have an array returned from HTTP call which looks as follows

 

[
["2013 TESCO","2013","Swindon Abbey Mds Exp","Unit 4 Village Centre","Elstree Way","Abbey Meads","SN25 4YX","TESCO","Template Form",null,null],
["2346 TESCO","2346","Gloucester Mead Rd Exp","Unit 1","Mead Road","Abbeymead","GL4 5GL","TESCO","Template Form",null,null],
["2015 TESCO","2015","Aberdare","Depot Road",null,"Aberdare","CF44 8DL","TESCO","Template Form",null,null],
["3729 TESCO","3729","Aberdare Pfs","Depot Road",null,"Aberdare","CF44 8DL","TESCO","Template Form",null,null],
["2001 TESCO","2001","Pittodrie Express","472 Kings Street",null,"Aberdeen","AB24 3DF","TESCO","Template Form",null,null],
["2007 TESCO","2007","Aberdeen Extra","Laurel Drive","Danestone","Aberdeen","AB22 8HB","TESCO","Template Form",null,null],
["3910 TESCO","3910","Aberdeen Extra Pfs","Laurel Drive","Danestone","Aberdeen","AB22 8HB","TESCO","Template Form",null,null],
["5512 TESCO","5512","Dyce Aberdeen Exp","35 Victoria Street","Dyce","Aberdeen","AB21 0ET","TESCO","Template Form",null,null],
["5639 TESCO","5639","Aberdeen Grt West Exp","571","Great Western Road","Aberdeen","AB10 6PA","TESCO","Template Form",null,null],["5689 TESCO","5689","Aberdeen Nrt Dees Exp","393 North Deeside Roa","Cults","Aberdeen","AB15 9SX","TESCO","Template Form",null,null]
]

 

I am trying to cycle through the array to see if the first field contains specfic text, but I am struggling to  be able to reference  the first , second items in an array etc without a field name 

 

i.e. does 5639 TESCO exist in the array

 

I believe it would be a selection of  compose or select but I am fumbling around in the dark with the syntax

 

Can anyone help

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support Team
Community Support Team

Re: How to Retrieve Data from Array with no named fields

Hi @JimTurner,

 

To get the first item in an array, please take the following flow for a reference.

In the following flow, I sue the array you provided for testing.

First, initialize variable, set the name as Test, type as String.

Add Compose action, input the array you provided.

Set variable, select compose output for the Value field.

Then add a Compose2, use the following code:

split(variables('Test'),']')

Then compose3, use the following code to get the first item:

skip(first(outputs('Compose_2')),3)

1.PNG2.PNG

Hope it could be a reference for you.

Reference material:

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#s...

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Highlighted
Community Support Team
Community Support Team

Re: How to Retrieve Data from Array with no named fields

Hi @JimTurner,

 

To get the first item in an array, please take the following flow for a reference.

In the following flow, I sue the array you provided for testing.

First, initialize variable, set the name as Test, type as String.

Add Compose action, input the array you provided.

Set variable, select compose output for the Value field.

Then add a Compose2, use the following code:

split(variables('Test'),']')

Then compose3, use the following code to get the first item:

skip(first(outputs('Compose_2')),3)

1.PNG2.PNG

Hope it could be a reference for you.

Reference material:

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#s...

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

JimTurner
Level: Powered On

Re: How to Retrieve Data from Array with no named fields

Hi Mabel

 

Many thanks for your guidance

 

and what you provided worked , However I tweaked

 

skip(first(outputs('Compose_2')),3)

 

to this

 

first(skip(outputs('Compose_2'),3))

 

so I could chnage the array item being found..

 

Its sets me off in the correct direction

Administrator
Administrator

Re: How to Retrieve Data from Array with no named fields

Hey, @JimTurner!

 

Thank you for posting to the Flow Community Forum! It appears you have found a solution to your issue! If you feel as though your issue has been solved and you are satisfied with one of the previous replies, please click "Accept as Solution" on the reply that contains the solution so that this thread will be marked for other users to easily identify!

 

Thank you for being an active member of the Flow Community!

 

-Gabriel
Microsoft Flow Community Manager

-Gabriel
Microsoft Power Automate Community Manager
Are YOU a member of your local Power Automate User Group?
Fill out This Form to claim your Community User Group Member Badge!

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,115)