Hey guys,
Having a bit of trouble setting a variable. Getting the following error:
Unable to process template language expressions in action 'Variable_to_store_title_value' inputs at line '1' and column '50651': 'The template language function 'if' expects three parameter: the condition to test as the first parameter, the value to return if the condition is true as the second parameter, and the value to return if the condition is false as the third parameter. The function was invoked with '2' parameter(s). Please see https://aka.ms/logicexpressions#if for usage details.'.
Variable and logic I use, note newWorkRequestNumber resolves to 0001 for all cases:
Name: titleValue
Type: String
Value:
@{if(equals(outputs('Get_response_details')?['body/rA'], 'Change Request'), concat('CR-', variables('newWorkRequestNumber'), ' ', outputs('Get_response_details')?['body/rX']),
if(equals(outputs('Get_response_details')?['body/rA'], 'Incident'), concat('INC-', variables('newWorkRequestNumber'), ' ' , outputs('Get_response_details')?['body/rX']),
if(equals(outputs('Get_response_details')?['body/rA'], 'Task'), concat('TSK-', variables('newWorkRequestNumber'), ' ' , outputs('Get_response_details')?['body/rX'])
))}
So I should always get either 'Change Request', 'Incident' or 'Task' for the conditional logic; which will created a new variable as CR-0001 TitleName. My logic seems to be working for Change Request and Incidents, but getting the above error for Tasks.
Any help would be appreciated.