Workflows - Call a API with one of the identity attribute values after comparing

I am planning to use a workflow to call a third party API. I need to send one of three identity attributes whichever is null to the third party API. I tried defining a variable and comparing if one is null, moving to check if ther is null too.
However variable once defined cannot be changed.

I am not sure how to compare these and store the value of attribute which is not null unless i duplicate the HTTP request call in each branch.

Do we have any other way?

How are you getting the identity attributes?
Does the response include the attribute even if it’s null or does it simply omit?

Using get identity action

Since you are only focussed on 3 identity attributes, I think you can hardcode them in the workflow. In that case, here’s an approach you can try - using two workflows
. In the current workflow, after Get Identity step setup Http request action to call the external trigger workflow. Include client id,secret and token url of the external workflow and in the request body hardcode the identity attributes along with identity id(sample below)

{
	"validateAttribute": [
		"attributes.firstname",
		"attributes.lastname",
		"attributes.workPhone"
	],
	"identityId": "{{$.getIdentity.id}}"
	
}

. In the external trigger workflow, loop over the input attributes from trigger and include identityid in the loop context. Within the loop perform http request action to call v3/search api, and use below request body in it.

{
    "indices": [
        "identities"
    ],
    "query": {
        "query": "id:\"{{$.loop.context}}\" AND _exists_:{{$.loop.loopInput}}"
    },
    "queryResultFilter": {
        "includes": [
            "id"
        ]
    }
}

. Perform Validate data type action to check if the above http response body exists. If no, then that particular attribute is null for the user and invoke third party api call. This way you can invoke third party api for the attribute whichever is null