web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Allowing blank field w...
Power Automate
Unanswered

Allowing blank field when using the replace function

(0) ShareShare
ReportReport
Posted on by 4
I have a flow that takes from a sharepoint list and sends an email.  There are multiline fields in the list.  I used the following to convert the line breaks to br
 
replace(outputs('Cursory_Cause'),decodeUriComponent('%0A'), '<br />')
If user leaves the field blank the flow does not run.  How do I allow for null input.
 
Thank you
Categories:
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,329 Super User 2025 Season 2 on at
     
    You have a couple of options
     
    1. You can put a Condition Action.
    In the left side put the expression empty() <== and in between the () put your outputs (which I am assuming is a string
    in the middle put is equal to
    on the right put the expression true (not the word)
     
    In the Yes side, do nothing, as your string is empty
    In the no side, you can put your compose above. 
     
    To make it cleaner per se, is you would use a variable and in the yes side use Set variable and set it to empty() or blank or null
    In the No side, use the Set variable and put your expression above.
     
    the other option is
    you can use coalesce, embedded in your replace
     
    replace(coalesce(outputs('Cursory_Cause'), "PUt something here not blank"),decodeUriComponent('%0A'), '<br />') which would either
     
    you could also build an expression that does something like
     
    @equals(empty(outputs('Cursory_Cause')), false), do your expression here)
     
    To me.. the condition one would, while maybe looking like extra steps, make it super easy to read and support later.
     
    If these suggestions help resolve your issue, Please consider Marking the answer as such and also maybe a like.
     
    Thank you!
    Sincerely, Michael Gernaey
     
  • DC-14071930-0 Profile Picture
    4 on at
    Thank you Michael,
     
    Question:  What do I put here:
  • Michael E. Gernaey Profile Picture
    53,329 Super User 2025 Season 2 on at
     
    Sorry i thought I answered your next question for some reason.
     
    It truly depends.
     
    realistically the easiest one to use if a condition versus an ugly expression. 
     
    but what I was saying below is, you would need to add anything " " or something else. My point being, if they gave you null, is that value going to be used further down to cause a problem somewhere else, so separating out this question, what do you need to make sure the rest of your flow works?
  • Srini007 Profile Picture
    3,327 Super User 2025 Season 2 on at
     
    Try below
     
    if(empty(outputs('Your_SharePoint_Item')?['Your_Multiline_Field']), '', replace(outputs('Your_SharePoint_Item')?['Your_Multiline_Field'], decodeUriComponent('%0A'), '<br />'))
     
    Hope this may helps you
     

    (If this answers your question you can mark as Answered and give it a Like)

    Regards,
    Srini

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard