Hello.
I am receiving the following errors regarding some workflows:
"One or more fields provided is of type 'Null', a different type is expected."
"InvalidTemplate. Unable to process template language expressions in action 'Send_an_email_notification_(V3)_2' inputs at line '0' and column '0': 'The template language function 'replace' expects its first parameter 'string' to be a string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#replace for usage details.'."
I am seeking assistance with how to fix these errors. I am thinking a 'replace' function should work if the field's value is 'null'. I found the following expression online: if(equals(<VALUE TO TEST>, null), 'Value if null', 'Value if not null')
If the value is 'null', I would like it to be replaced with a space (if not possible, a period or dash will work). If it is not 'null' I want the field to execute another 'replace' function, so plain text can have line breaks. For the line breaks, I am using this expression and it is working so far on its own when the field is not 'null': replace(triggerOutputs()?['body/SMComments'],outputs('NewLine'),'</br>')
When I try to combine the expressions, Power Automate says the expression is invalid. May some assist me with trying to combine these expressions into one or provide an alternative that would have the same result I am looking for? This is the invalid expression I have been attempting: if(equals(triggerOutputs()?['body/SMComments'], null), -, replace(triggerOutputs()?['body/SMComments'],outputs('NewLine'),'</br>'))
Any help would be greatly appreciated!