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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Concatenate non empty ...
Power Automate
Suggested Answer

Concatenate non empty dynamic values in an email

(0) ShareShare
ReportReport
Posted on by
Hi,
 
In Power Automate, I wanted to list all non empty outputs in an automated email separated by commas. So for example, if there are 3 outputs that and one of them is empty (let's say Value3 is empty) then I want to list the 2 non empty values as: Value1, Value 2. Currently when I use the concat function it lists the values with unnecessary commas for the empty values: Value1, Value2,,
 
How do I fix this?
Categories:
I have the same question (0)
  • Suggested answer
    David_MA Profile Picture
    14,085 Super User 2026 Season 1 on at
    Look into the coalesce expression as I think that can solve your problem: Power Automate Coalesce Function Explained

    I think you'll need something like this: concat(coalesce(items('Get_items')?['Value1'], ''), if(equals(coalesce(items('Get_items')?['Value2'], ''), ''), '', concat(',', coalesce(items('Get_items')?['Value2'], ''))), if(equals(coalesce(items('Get_items')?['Value3'], ''), ''), '', concat(',', coalesce(items('Get_items')?['Value3'], ''))))
  • Suggested answer
    Meekou Profile Picture
    200 Moderator on at
    For removing empty items before join multiple items, you could try options below:
    • You could try to loop the outputs, then check if the outputs is empty, if not, concat the result
    • Try to create array based on the outputs, and then filter the output by not empty, and finally join the result
    For the second option, here is a simple demo:
    • Use multiple Compose action to mock your multiple outputs
    • Add Filter Array action to filter outputs
    Here is the code for above
    {
        "inputs": {
            "from": "@createArray(outputs('Compose1'),outputs('Compose2'),outputs('Compose3'))",
            "where": "@not(equals(item(),string(null)))"
        }
    }
    • Create Reusult
    Here is code view
    {
        "inputs": "@join(body('Filter_array'),',')"
    }
    Regards,
    Meekou
  • VictorIvanidze Profile Picture
    13,079 on at
    Try this:
     
    replace(concat(items('Get_items')?['Value1'],',', items('Get_items')?['Value2'],',',items('Get_items')?['Value3']),',,',',')
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 594

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 281 Super User 2026 Season 1

Last 30 days Overall leaderboard