What would be the code to automate the fetching of data and creation of multiple JSON payloads with same parameters and structure, only the values change every-time?
Eg: I have a payload like this:
{
"advertiserProfileInputs": [
{
"advertiserIdType": "ADVERTISER",
"advertiserId": "**XYZ**",
"marketplaceId": "US001",
"process": "sponsor"
}
]
}
I have a dataset (in an excel file) of multiple advertiserType-(Advertiser, Entity etc) , advertiserId-(XYZ, ABC, DEF, GHI etc) , process-(sponsor, store etc). [Note : Each array has only one and unique set of data only.]
My target is to create the payload with the same structure but every-time the data changes automatically. The data may change for multiple parameters as well. Expected Output :-
{
"advertiserProfileInputs": [
{
"advertiserIdType": "ADVERTISER",
"advertiserId": "ABC",
"marketplaceId": "US001",
"process": "sponsor"
}
]
}
{
"advertiserProfileInputs": [
{
"advertiserIdType": "ADVERTISER",
"advertiserId": "GHI",
"marketplaceId": "US001",
"process": "store"
}
]
}
]
. . . and so on.
Tried looking through a multiple number of solutions but all of them were mostly related to different problems.