Hi all, I want to start reusing my json payload templates more so I don’t have so many of them. Problem is I don’t know how to deal with variable number of fields in a similar json template.
For example: in a tenant hierarchy, the first time I create a tenant it has no parent and goes to top of hierarchy. The second…nth time I run through the “createTenant” script the first tenant becomes the parent with parentId in the payload creating the relationship between top and second level of hierarchy.
TopLevelTenant.json:
{
“tenantDescription”: “${tenantDescription}”,
“displayName”: “${tenantDisplayName}”,
“email”: “${tenantName}@doe.com”,
“url”: “https://${tenantName}.com”,
“tenantName”: “${tenantName}”
}
SecondLevelTenant.json:
{
“tenantDescription”: “${tenantDescription}”,
“displayName”: “${tenantDisplayName}”,
“email”: “${tenantName}@doe.com”,
“url”: “https://${tenantName}.com”,
“tenantName”: “${tenantName}”
“parentId”: “${parentId}”
}
Can you give me a hint on how to make something like this more reusable and put both in one json template?