Flatting in Azure data factory

mustafa.ispir 21 Reputation points
2022-07-20T11:27:54.483+00:00

I have a column which include json values as string format ;

[{"client_key":"82dsa89da0e12da0","roles":[{"role_name":"Deneme 1","group_role_name_key":"83210830da8sd0ad21","role_name_id":"12345","encoded_key":"9dsad798a7sd9"}]},
{"client_key":"7sdac79sad09a798s79","roles":[]},
{"client_key":"djkl21ldjlsajd2121","roles":[]}]

And i want to this output

client_key
82dsa89da0e12da0
7sdac79sad09a798s79
djkl21ldjlsajd2121

First i split this column in derived columns ;

split(replace(replace(replace(group_members,'[',''),']',''),'},{','}|{'),'|')

222599-image.png

Then i use flatten to unroll.

222722-image.png

And when i parsed it like below
222712-image.png

I see null client keys like this.

222687-image.png

How can i handle it ?

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,627 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.