I’m attempting to create an ‘if’ expression in the body of one of my flows that handles data from Forms. I need the flow to only include an answer (in an email that is sent to the help desk), only if another question is answered ‘yes’, for example:
Forms question 1: Do you wish to remote into your PC?
Forms question 2 (will only show if question 1 is answered with ‘yes’): Enter the host name of your computer
I need the flow to only add the hostname (from question 2) (into the email that is sent) if question 1 is answered with ‘yes’.
For testing purposes, I have tried the following expression for the first part (to check if the answer is ‘yes’ or ‘no’):
if(triggerBody()?['rcee21e8ca796498da50d37db60e7bd92'],'rdp required','rdp not required')
but I see the following error when testing:
InvalidTemplate. Unable to process template language expressions in action 'Send_an_email_(V2)' inputs at line '1' and column '2843': 'The template language function 'if' expects its first parameter to be of type boolean. The provided value is of type 'String'. Please see https://aka.ms/logicexpressions#if for usage details.'.
My idea is that the hostname (from question 2) will only be stated in the email if question 1 is answers with ‘yes’.