json formatting question

in the message definitions, i choose different values in the form from different entities via associations. now the json format coming out is like below. {"Field1": "Data1", "Field2": {"Field2": "Data2", "Field3": "Data3"}} Field1 is from main entity and Field2 is associated entities. now i want the json format to be like below so the recieving service can handle this correctly. . How can this be done . Can this be done in export mapping ? or message definitions ? {"Field1": "Data1", Field2": "Data2", "Field3": "Data3"}
1 answers

To do this, you need to put the original associated objects in a new flat object that contains attributes field1, field 2, field3. Do this in a microflow, and afterwards export the flat object using a new export mapping to a string to create the result you need.