question

PhilipBinil-6116 avatar image
0 Votes"
PhilipBinil-6116 asked MartinJaffer-MSFT commented

Need to filter fields from a Json Array in data flow in Azure Data factory

Hello ,

I am trying to filter some values from a json array ,
trued using filter function in dataflow but its not returning any value ,

I only need three fields from the below structure ,

Have tried using the expression as below ,
filter(directTerritory, toString(#item) == 'vendorNumber' || toString(#item) == 'vendorAccountName')


the structure of json data is as such below ,

"directTerritory": [
{
"vendorNumber": "str1234",
"vendorAccountName": "str1234",
"directTerritory": "st",
"directTerritoryDescription": "str1234",
"irishTerritory": "s"
},
{
"vendorNumber": "str1234",
"vendorAccountName": "str1234",
"directTerritory": "st",
"directTerritoryDescription": "str1234",
"irishTerritory": "s"
},
{
"vendorNumber": "str1234",
"vendorAccountName": "str1234",
"directTerritory": "st",
"directTerritoryDescription": "str1234",
"irishTerritory": "s"
}
]

can some one help me on this or any other way achieving the result

azure-data-factory
· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Can you provide a screenshot, the filter activity I know of doesn't have that syntax so just to get a better idea of where you are...

Highly doubt you should have quotes around VendorNumber/VendorAccountName though

0 Votes 0 ·

screen shot how i am trying to get the value ..
and the representation of the data
117794-image.png


0 Votes 0 ·
image.png (65.5 KiB)

What are you trying to get as an end result?

I'm suspecting you're trying to drop attributes of each object (based on a re-read of original post) which isn't what the filter does

1 Vote 1 ·

hello
Above i have provided a screen shot how i am trying to get the value ..
and the representation of the data.

0 Votes 0 ·

RyanAbbey is right, that is not what filter does. Filter drops entire records if they do not meet criteria. Vendor is a property of a record, not a record itself.

0 Votes 0 ·

0 Answers