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:
  • Suggested answer
    David_MA Profile Picture
    15,585 Super User 2026 Season 2 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,083 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 355

#2
11manish Profile Picture

11manish 336 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard