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 Apps / Conditional Concatenat...
Power Apps
Answered

Conditional Concatenation of multiple inputs based on toggling Check boxes

(0) ShareShare
ReportReport
Posted on by 139

Building a PowerApp with SharePoint list as a base.  Found several Concatenate and IF posts in the forum and throughout the web, but couldn't find what I was looking for.  Hoping someone here can help.

 

Inputs:

  • cboComboBox1.Selected.SharePointColumnName (Lookup)
  • cboComboBox2.Selected.SharePointColumnName (Lookup)
  • chkCheckBox1.Value
  • txtTextBox1.Text
  • chkCheckBox2.Value
  • txtTextBox2.Text
  • txtTextBox3.Text

What I want to accomplish:

 

  • If chkCheckBox1.Value = false && chkCheckBox2.Value = false, then txtTextBox3.Text = 

 

Concatenate(
 cboComboBox1.Selected.SharePointColumnName, " ",
 txtTextBox2.Text
 )

 

  • If chkCheckBox1.Value = true && chkCheckBox1.Value = false, then txtTextBox3.Text =

 

Concatenate(
 cboComboBox1.Selected.SharePointColumnName, " ",
 cboComboBox2.Selected.SharePointColumnName, " ",
 txtTextBox2.Text
 )

 

  • If chkCheckBox1.Value = false && chkCheckBox2.Value = true, then txtTextBox3.Text = 

 

Concatenate(
 cboComboBox1.Selected.SharePointColumnName, " ",
 txtTextBox1.Text, " ",
 txtTextBox2.Text
 )

 

  • If chkCheckBox1.Value = true && chkCheckBox2.Value = true, then txtTextBox3.Text =

 

Concatenate(
 cboComboBox1.Selected.SharePointColumnName, " ",
 cboComboBox2.Selected.SharePointColumnName, " ",
 txtTextBox1.Text, " ",
 txtTextBox2.Text
 )

 

 

I was hoping that this would work, I should have known that it would not be this easy:

 

Concatenate(
 cboComboBox1.Selected.SharePointColumnName, " ",
 If(chkCheckBox1.Value = true, 
 Concatenate(cboComboBox2.Selected.SharePointColumnName," ")
 ),
 If(chkCheckBox2.Value = true,
 Concatenate(txtTextBox2.Text," ")),
 textBox3.Text
 )

 

 

Thanks in advance.

 

Categories:
  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at
    I like to do the testing first for readability. Something like the function below.
    I would also suggest to look into the Concat() function. That will improve readability a bit further.
     
    If(
    //both false
        And(
            !chkCheckBox1.Value,
            !chkCheckBox2.Value
        ),
        Concatenate(
            cboComboBox1.Selected.SharePointColumnName,
            " ",
            txtTextBox2.Text
        ),
    //1 true, 2 false
        And(
            chkCheckBox1.Value,
            !chkCheckBox2.Value        
        ),
        Concatenate(
            cboComboBox1.Selected.SharePointColumnName, " ",
            cboComboBox2.Selected.SharePointColumnName, " ",
            txtTextBox2.Text
        ),
    //1 false, 2 true
        And(
            !chkCheckBox1.Value,
            chkCheckBox2.Value        
        ),
        Concatenate(
            cboComboBox1.Selected.SharePointColumnName, " ",
            txtTextBox1.Text, " ",
            txtTextBox2.Text
        ),
    //else, so bot true
        Concatenate(
            cboComboBox1.Selected.SharePointColumnName, " ",
            cboComboBox2.Selected.SharePointColumnName, " ",
            txtTextBox1.Text, " ",
            txtTextBox2.Text
        )
    )
  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @stayinginsync 

    This is my go at it:

    With({
     condition1:Concatenate( //Both checkboxes checked
     cboComboBox1.Selected.SharePointColumnName, " ",
     cboComboBox2.Selected.SharePointColumnName, " ",
     txtTextBox1.Text, " ",
     txtTextBox2.Text
     ),
     condition2:Concatenate( //Checkbox1 checked
     cboComboBox1.Selected.SharePointColumnName, " ",
     cboComboBox2.Selected.SharePointColumnName, " ",
     txtTextBox2.Text
     ),
     condition3:Concatenate( //Checkbox2 checked
     cboComboBox1.Selected.SharePointColumnName, " ",
     txtTextBox2.Text
     ),
     Condition4: textBox3.Text //Neither checkbox checked
     },
     
     If(
     chkCheckbox1.Value and chkCheckbox2.Value,
     condition1, 
     chkCheckbox1.Value and !chkCheckbox2.Value,
     condition2,
     !chkCheckbox1.Value and chkCheckbox2.Value,
     condition3,
     !chkCheckbox1.Value and !chkCheckbox2.Value, 
     condition4,
     )
    )
     
  • stayinginsync Profile Picture
    139 on at

    @Anonymous 

     

    Thanks.  That did the trick.  I'll look into Concat too.

  • stayinginsync Profile Picture
    139 on at

    @Anonymous , @Drrickryp ,

     

    Thank you both.  I ended up using @Anonymous 's.  However, while this technique works great for the initial FormMode.New of the SharePoint form, when I go to Edit the SharePoint item, txtTextBox3.Text is not populating with the cboComboBox1, nor cboComboBox2 Parent SelectedItems, just the txtTextBox1.Text &txtTextBox2.Text.  

     

    This was after the work I did with @WarrenBelz in this thread.

     

    Thanks in advance.

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 Apps

#1
11manish Profile Picture

11manish 360 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 325

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard