Across an array of data, how to require a particular value appear once?

I am am trying to generate data such as the following

[{
    "id": 1,
    "company": "Doogle",
    "contacts": [{ 
        "primary": true,
        "first_name": "John",
        "last_name": "Doe"
    }]
},
{
    "id": 2,
    "company": "Bahoo",
    "contacts": [{ 
        "primary": false,
        "first_name": "Peter",
        "last_name": "Drake"
    },
    { 
        "primary": true,
        "first_name": "Jane",
        "last_name": "Smith"
    }]
}]

Contacts is an array of objects, how do I enforce the rule that one and only one contact can be primary and there must be at least one primary contact?

It takes a bit of trickery:

The trick is to create a custom list for the “primary” field where the first value is true and the subsequent values are false (repeated as many times as the max number of elements in the array) using the sequential distribution option. I also added an inline formula to convert “true” and “false” to true and false.