Forum Discussion

pjuvish's avatar
pjuvish
Copper Contributor
Nov 01, 2021

Need help putting a dynamic content in if( , , ) function

Hi experts!

 

I am trying to create a condition of whether there is a response from my MS Form.

If no, I want it to leave a blank space but if yes, I want to add some HTML <li> </li> and a response from MS Form in the element, the HTML itself works just fine but it turns out to be invalid as soon as I add this dynamic content outputs('Get_response_details')?['body/rbd8730a075a74ca4a315dae7b898c2f4'] in the false value section of if( , , )

 

Can you please help me identify what's wrong with the code below?

if(empty(outputs('Get_response_details')?['body/rbd8730a075a74ca4a315dae7b898c2f4'])," ","<li>Destination: outputs('Get_response_details')?['body/rbd8730a075a74ca4a315dae7b898c2f4']</li>")

 

Thank you in advance!

pjuvish

  • DanWatford's avatar
    DanWatford
    Copper Contributor

    Hi pjuvish 

     

    It's not clear to me what you mean by 'it turns out to be invalid'. Are you getting some sort of error displayed in your browser? Are you generating an HTML file?

     

    I imagine you are getting the literal "Destination: outputs('Get_...." in your result. If so then you need to concatenate some string parts together.

     

    Please see if the following works for you:

     

    if(empty(outputs('Get_response_details')?['body/rbd8730a075a74ca4a315dae7b898c2f4'])," ","<li>Destination: " & outputs('Get_response_details')?['body/rbd8730a075a74ca4a315dae7b898c2f4'] & "</li>")

     

     

Resources