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 / How to either return t...
Power Automate
Unanswered

How to either return the value of a colum or return a specific text if empty?

(0) ShareShare
ReportReport
Posted on by

Hi,

 

I have a simple Flow that pulls together a number of colums from a SharePoint list and puts them into a HTML table which gets emailed.  The issue I am hitting is one of these columns is a "choice" column and if the a user creates an item and doesn't select a choice from the list the Flow fails because the column doesn't contain anything.

 

 

What I am trying to achieve is if the column contains a value then that value is written to the HTML table, or if there is no value the Flow updates the HTML table with "Not Set" text.

 

 

Any help gratefully received.

 

Rob

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    on at

    I've come across null values myself lately. They can be frustrating. You can always check for a null value in a column with this formula to check for empty value: @empty(triggerBody()?['Name_Column/Variable']

     

    To acheive what you want to do you need an if formula that checks if the column is empty. If the column is empty (evaluates to true) you can use a replace function. If the condition evaluates to false you do nothing.

     

    Formula (I didn't fully test this, but can you try this)?

     

    if(@empty(triggerBody()?['Name_Column/Variable'],replace(['Name_Column/Variable'],'Not Set'),'')

     

     

  • Verified answer
    v-yuazh-msft Profile Picture
    on at

    Hi @Rob_CTL,

     

    I have made a test on my side and have create a "status" column with type "choice" in the sharepoint list.

     

    The screenshot of the sharepoint list as below:

    Capture.PNG

     

    You could refer to screenshot below to create the flow:

    Capture.PNG

     

    Th expression for the status column as below:

    if(empty(item()?['status']?['Value']),'Not Set',item()?['status']?['Value'])

    The flow would run successsfully as below:

    Capture.PNG

     

     

    Best regards,

    Alice

     

     

  • Rob_CTL Profile Picture
    on at

    Thanks @v-yuazh-msft and @Anonymous for the help, that worked perfectly!

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