HI All,
Need some help
I am getting the following JSON Response.
| JSON_Name | JSON_ValueString |
| data.findCompanyByCompanyId.companyId | CDM001 |
| data.findCompanyByCompanyId.companyIdentifiers.0.idType | FCA |
| data.findCompanyByCompanyId.companyIdentifiers.0.idValue | 295268 |
| data.findCompanyByCompanyId.companyIdentifiers.1.idType | CAS |
| data.findCompanyByCompanyId.companyIdentifiers.1.idValue | 78047108 |
| data.findCompanyByCompanyId.companyId | CDM002 |
| data.findCompanyByCompanyId.companyIdentifiers.0.idType | LEI |
| data.findCompanyByCompanyId.companyIdentifiers.0.idValue | 5493002O03IRC3O7AT88 |
| data.findCompanyByCompanyId.companyId | CDM003 |
| data.findCompanyByCompanyId.companyIdentifiers.0.idType | NAICS |
| data.findCompanyByCompanyId.companyIdentifiers.0.idValue | 99999 |
| data.findCompanyByCompanyId.companyId | CDM004 |
| data.findCompanyByCompanyId.companyIdentifiers.0.idType | FCA |
| data.findCompanyByCompanyId.companyIdentifiers.0.idValue | 079679 |
AIM - For every Company ID there might be referential Ids associated.
Every companyIdentifiers.0.idType represents the Name of the referential ID (ie, Naics, Lei, FCA, CasID), the IDvalue represents the value of the Referential ID
NB : At the moment idType are the only 4 values, however there are plans to bring in two new values in the next coming months.
What i would like help with is, is there a way to dynamically identify the name in the idType and create a column Dynamically, and then put the corresponding idValue in the IDType against the corresponding companyId
Expected outcome
| companyId | FCA | CAS | LEI | NAICS |
| CDM001 | 295268 | 78047108 | | |
| CDM002 | | | 5493002O03IRC3O7AT88 | |
| CDM003 | | | | 99999 |
| CDM004 | 079679 | | | |
Looking forward to your response
Many thanks
Masond3