How to create dynamic body in http request workflow

Hi Team,
I have a workflow that picks certain identity attributes store them into variables and then pass those variables in an http request.
What i want if some of those attributes are not present in the user’s identity profile then remove the entire key value pair.
Currently it is coming like this

{
“approvalLimit”: “$.getIdentity.attributes.sapeccapprovallmit”,
“companyCode”: “8sdf4”,
“costCenter”: “sfd”,
“currency”: “USD”,
“dataOK”: “Y”,
“email”: “sdfds”,
“firstName”: “sdf”,
“language”: “English (United States)”,
“lastName”: “sdf”,
“managerEID”: “sdfsd”,
“plant”: “$.getIdentity.attributes.sapeccplant”,
“purchasingOrg”: “dfsdf”,
“userName”: “dds”

as you can see two attributes came in as variables itself because they do not exist.

If that’s the scenario then i don’t want them in payload.
How can i achieve this?