I have this json array which i am passing as part of an http request boy:-

here is the string:-
"peoplePickerInput":"[ { \"Key\":\"@{items('Apply_to_each_-_Certificates_2')?['EmailAddressNo1']}\"},{ \"Key\":\"@{items('Apply_to_each_-_Certificates_2')?['EmailAddressNo2']}\" } ]"
now i want to build a compose to check if the following is empty:-
@{items('Apply_to_each_-_Certificates_2')?['EmailAddressNo2']}
and if so to only have one item inside the array:-
"peoplePickerInput":"[ { \"Key\":\"@{items('Apply_to_each_-_Certificates_2')?['EmailAddressNo1']}\"}]"
so how i can do this inside compose and pass the output of the compose to the ""Send http request" action ?