Hello @Sydney ,
Thanks for the question and using MS Q&A platform.
As per my understanding you would like to split the above complex json based on resourceType
column and load them to respective table in your sink. Please correct if my understanding is incorrect.
You can use mapping data flow transformations to achieve the above requirement.
- First point to your source in source transformation and then under
source options
go toJson settings
and selectArray of documents
- Then have a
flatten transformation
to flatten the JSON source.Unroll by
members as shown below and in the input column select as shown below so that all the columns are taken.
- Then have a
conditional split
transformation to split the unrolled json source base on theresourceType
column values as shown below:
- Then have a derived column to transform the name, CertificateLevel, CertificateObtainedYear, Title columns as per your requirment as shown below.
For name
you can use this expression: reduce(name.given, '', #acc + #item + ' ', #result + name.family)
For Certification level
you can use this: byPath('TeachingCertificate.level')
For CertificationYearObtained
use this: byPath('TeachingCertificate.yearObtained')
For title
use this : byPath('name.Title')
- Next have a sink transformation and select only the column you need for your sink table and map them as shown below.
- For
Student
stream have a derived column to transform the name column as per your requirment.
- Then have a sink transformation and select only the columns required for your student table and map them accordingly as shown below.
This will copy the data to respective tables in your sink.
Hope this will help. Please let us know if any further queries.
------------------------------
- Please don't forget to click on or upvote button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
- Want a reminder to come back and check responses? Here is how to subscribe to a notification
- If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators