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 / Replace blank fields w...
Power Automate
Unanswered

Replace blank fields with n/a

(0) ShareShare
ReportReport
Posted on by

Hello,

 

Background:

I have a flow that displays which form fields have changed. I am using the "Get changes for item or a file (properties only)" Sharepoint action. Since it wasn't possible to only return which items were changed, I created an html table that displays all of the form fields and then highlights which fields were changed.

 

My Question:

Since I have to display all of the form fields, some are inevitably blank. When this is the case, I would like to display n/a so it is clear that the field was left intentionally blank. The fields with the potential to be blank are single line of text fields in my Sharepoint data source. Cost Center is a number field. What expression can I write that will make the substitution?

 

I'm new to this so your advice is much appreciated. Thank you- Teresa

 

Email Screenshot:

 

ChangeEmailSS.png

HTML Screenshot:

Here is the highlight expression I used in the tr bgcolor tag. I would like to insert a conditional expression to replace blank fields with n/a in place of the dynamic content I current have inserted to the right.

 

HighlightExpression.png

 

Categories:
I have the same question (0)
  • Ellis Karim Profile Picture
    11,681 Super User 2025 Season 2 on at

    You could try to check for an empty condition or null value:

     

    if(empty(item()?['Mobile']), 'n/a', item()?['Mobile'])
    
    if(equals(item()['last_in'], null),'n/a',formatDateTime(item()['last_in'],'dd-MM-yyyy hh:mmtt'))

     

     Ellis

  • tagustin2020 Profile Picture
    on at

    @ekarim2020 

     

    Hello,

     

    Thank you for the suggestion. Here is my first attempt at writing the expression. The flow failed.

     

    ExpAttempt.png


    Here is the error message I received during the first test run.

     

    ErrorMessage.png

     

    I adjusted by adding "true" to the expression to see if that would help, but it still failed.

     

    ExpTrue.png

     

    Here is the error message I received on the second test run. It is the same as the first. Since we are testing whether or not is empty is true and then providing instructions what to do if the expression evaluates to true and what to do if it evaluates to false, I'm not quite sure where the disconnect is. Are you able to spot what I am doing wrong?

     

    ErrorMessage2.png

     

    Thank you,

    Teresa

     

  • Verified answer
    Ellis Karim Profile Picture
    11,681 Super User 2025 Season 2 on at

     

    The empty function needs to be in this format:  if(empty(column), 'n/a', <value to set>)

    Your condition would resemble something like:

    if (empty(triggerOutputs()?['body/Recipient']), 'n/a', triggerOutputs()?['body/Recipient'])

    Ellis

     

  • tagustin2020 Profile Picture
    on at

    @ekarim2020 

     

    Hello,

     

    Sorry for the delay in response. So far I'm not having any luck with these expressions. Any ideas of what else I could try? Maybe it's just me. Have you run successful tests on your end?

     

    Teresa

  • Ellis Karim Profile Picture
    11,681 Super User 2025 Season 2 on at

    What is the current error message or output you are getting?

    I would start with a new, simpler flow for testing. We will test whether Email2 is empty, and return the text "Empty" or "Not Empty" accordingly.

    ekarim2020_7-1629230486036.png

    You can use the following data to create a simple flow:

     

    {
     "Name": "Alex Wilber",
     "Email1": "awilber@office.com",
     "Email2": "",
     "Mobile1": "0123456789",
     "Mobile2": ""
    }

     

    Initialize the following variable of type Object (JSON object) and then copy-and-paste the above text into the value:

    ekarim2020_5-1629229980154.png

    Next, create a compose action:

    ekarim2020_3-1629229553361.png

    Enter the following expression to test whether Email2 is blank or empty:

     

    if(empty(variables('varData')['Email2']),'Empty','Not Empty')

     

    I ran two tests with Email2, one with blank and the other with content:

    ekarim2020_6-1629230072904.png

    Hope this helps with debugging what is going on in your flow.

    Ellis

     

     

  • tagustin2020 Profile Picture
    on at

    @ekarim2020 

     

    Hello,

     

    Thank you for the follow-up example. I'm not trying to edit person fields, but I will definitely save your screenshots for future reference!

     

    I'm not sure why I was having trouble getting your original suggestion to work. I tried again today and it worked fine so I am going to mark it as the solution for my particular issue.

     

    Expression:

     

    CostCtrExpression.png

     

    Result:

    CostCtrNASuccess.png

    Here is the expression I used to get changed fields to highlight in blue in case anyone is curious.

     

    LightBlueExpression.png

     

    Thanks again for helping me. You're the best!

    Teresa

  • testuser1980 Profile Picture
    2 on at

    Hi Ellis,

     

    That worked. thanks.

     

    However I am trying to modify this logic a little bit, whereby instead of returning "n/a" when empty, it should highlight the empty field with a yellow highlighted color/font. Is that possible?

     

    So if the field is empty, it should be highlighted in yellow, else return the value if present. I am struggling to tweak your condition accordingly. Please suggest.

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard