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 Apps / Concatenate without bl...
Power Apps
Suggested Answer

Concatenate without blank lines

(0) ShareShare
ReportReport
Posted on by
Hi All,
 
I have the below working well in the way i wanted it to however want to tweak a little. at the moment the formula ignores if a question is blank giving me the below
 
Question 1: ABCDEFG

Question 2: HIJKLMN
Question 4: OPQRST
 
however I want it to look like this, any suggestions. the output text field will be used in an email notification.
 
Question 1: ABCDEFG
Question 2: HIJKLMN
Question 4: OPQRST
 
 
TrimEnds(Concatenate(
If(Q1_label.Text<>"",Q1_label.Text&" "),If(N1.Text<>"",N1.Text&" "),Char(13),Char(13),
If(Q2_label.Text<>"",Q2_label.Text&" "),If(N2.Text<>"",N2.Text&" "),Char(13),Char(13),
If(Q3_label.Text<>"",Q3_label.Text&" "),If(N3.Text<>"",N3.Text&" "),Char(13),Char(13),
If(Q4_label.Text<>"",Q4_label.Text&" "),If(N4.Text<>"",N4.Text&" "),Char(13),Char(13),
If(Q5_label.Text<>"",Q5_label.Text&" "),If(N5.Text<>"",N5.Text&" "),Char(13),Char(13),
If(Q6_label.Text<>"",Q6_label.Text&" "),If(N6.Text<>"",N6.Text&" "),Char(13),Char(13),
If(Q7_label.Text<>"",Q7_label.Text&" "),If(N7.Text<>"",N7.Text&" "),Char(13),Char(13),
If(Q8_label.Text<>"",Q8_label.Text&" "),If(N8.Text<>"",N8.Text&" "),Char(13),Char(13),
If(Q9_label.Text<>"",Q9_label.Text&" "),If(N9.Text<>"",N9.Text&" "),Char(13),Char(13),
If(Q10_label.Text<>"",Q10_label.Text&" "),If(N10.Text<>"",N10.Text&" "),Char(13),Char(13),
If(Q11_label.Text<>"",Q11_label.Text&" "),If(N11.Text<>"",N11.Text&" "),Char(13),Char(13),
If(Q12_label.Text<>"",Q12_label.Text&" "),If(N12.Text<>"",N12.Text&" "),Char(13),Char(13),
If(Q13_label.Text<>"",Q13_label.Text&" "),If(N13.Text<>"",N13.Text&" "),Char(13),Char(13),
If(Q14_label.Text<>"",Q14_label.Text&" "),If(N14.Text<>"",N14.Text&" "),Char(13),Char(13),
If(Q15_label.Text<>"",Q15_label.Text&" "),If(N15.Text<>"",N15.Text&" "),Char(13),Char(13),
If(Q16_label.Text<>"",Q16_label.Text&" "),If(N16.Text<>"",N16.Text&" "),Char(13),Char(13)))



 
I have the same question (0)
  • Suggested answer
    mmbr1606 Profile Picture
    14,605 Super User 2025 Season 2 on at
    hey
     
    can u try this:
     
    TrimEnds(Concatenate(
        If(Q1_label.Text<>"" && N1.Text<>"", Q1_label.Text & ": " & N1.Text & Char(13), ""),
        If(Q2_label.Text<>"" && N2.Text<>"", Q2_label.Text & ": " & N2.Text & Char(13), ""),
        If(Q3_label.Text<>"" && N3.Text<>"", Q3_label.Text & ": " & N3.Text & Char(13), ""),
        If(Q4_label.Text<>"" && N4.Text<>"", Q4_label.Text & ": " & N4.Text & Char(13), ""),
        If(Q5_label.Text<>"" && N5.Text<>"", Q5_label.Text & ": " & N5.Text & Char(13), ""),
        If(Q6_label.Text<>"" && N6.Text<>"", Q6_label.Text & ": " & N6.Text & Char(13), ""),
        If(Q7_label.Text<>"" && N7.Text<>"", Q7_label.Text & ": " & N7.Text & Char(13), ""),
        If(Q8_label.Text<>"" && N8.Text<>"", Q8_label.Text & ": " & N8.Text & Char(13), ""),
        If(Q9_label.Text<>"" && N9.Text<>"", Q9_label.Text & ": " & N9.Text & Char(13), ""),
        If(Q10_label.Text<>"" && N10.Text<>"", Q10_label.Text & ": " & N10.Text & Char(13), ""),
        If(Q11_label.Text<>"" && N11.Text<>"", Q11_label.Text & ": " & N11.Text & Char(13), ""),
        If(Q12_label.Text<>"" && N12.Text<>"", Q12_label.Text & ": " & N12.Text & Char(13), ""),
        If(Q13_label.Text<>"" && N13.Text<>"", Q13_label.Text & ": " & N13.Text & Char(13), ""),
        If(Q14_label.Text<>"" && N14.Text<>"", Q14_label.Text & ": " & N14.Text & Char(13), ""),
        If(Q15_label.Text<>"" && N15.Text<>"", Q15_label.Text & ": " & N15.Text & Char(13), ""),
        If(Q16_label.Text<>"" && N16.Text<>"", Q16_label.Text & ": " & N16.Text & Char(13), "")
    ))
    
     
     
     
    if it works please mark as verified answer
     
    cheers
     
  • Mclean2023 Profile Picture
    79 on at
    Thanks for your quick reply, I have tried your suggestion but didn't have the outcome I was looking for, below is what I end up with
     
     
    Output I'm looking for
     
    Question 1: Comment 1
    Question 3: Comment 2
    Question 4: Comment 3
    Question 5: Comment 4
    Question 7: Comment 5
     
  • Suggested answer
    Mclean2023 Profile Picture
    79 on at
    Found a working solution: limiting the formula to only one field helped 
     
    Concatenate(
     
    If(!IsBlank(N1.Text), "Answer 1: " & N1.Text & Char(10) & Char(10), ""),
    If(!IsBlank(N2.Text), "Answer 2: " & N2.Text & Char(10) & Char(10), ""),
    If(!IsBlank(N3.Text), "Answer 3: " & N3.Text & Char(10) & Char(10), ""),
    If(!IsBlank(N4.Text), "Answer 4: " & N4.Text & Char(10) & Char(10), ""),
    If(!IsBlank(N5.Text), "Answer 5: " & N5.Text & Char(10) & Char(10), ""),
    If(!IsBlank(N6.Text), "Answer 6: " & N6.Text & Char(10) & Char(10), ""),
    If(!IsBlank(N7.Text), "Answer 7: " & N7.Text & Char(10) & Char(10), ""),
    If(!IsBlank(N8.Text), "Answer 8: " & N8.Text & Char(10) & Char(10), ""),
    If(!IsBlank(N9.Text), "Answer 9: " & N9.Text & Char(10) & Char(10), ""),
    If(!IsBlank(N10.Text), "Answer 10: " & N10.Text & Char(10) & Char(10), ""),
    If(!IsBlank(N11.Text), "Answer 11: " & N11.Text & Char(10) & Char(10), ""),
    If(!IsBlank(N12.Text), "Answer 12: " & N12.Text & Char(10) & Char(10), ""),
    If(!IsBlank(N13.Text), "Answer 13: " & N13.Text & Char(10) & Char(10), ""),
    If(!IsBlank(N14.Text), "Answer 14: " & N14.Text & Char(10) & Char(10), ""),
    If(!IsBlank(N15.Text), "Answer 15: " & N15.Text & Char(10) & Char(10), ""),
    If(!IsBlank(N16.Text), "Answer 16: " & N16.Text & Char(10) & Char(10), "")
     
    )
     
    Output now looks correct,
    If I update question 14 with an answers it adds correctly

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard