cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
slhangen
Helper V
Helper V

Patch contents of multiple controls

I have an app that teachers use to log intervention attempts.

The interventions are populated from a combo box. I also have an input text box in case the needed intervention is not in the list.

I have a text box that allows user to see selected items, I then patch the text box contents.

The text box is calculated with:

 

Concat(cbStrengthSelections.SelectedItems, 'Strengths (Strengths)' & "; "&iptAddStrength.Text)

 

cbStrengthSelections is the combobox with stock items

iptAddStrength is the text box where user adds custom items

 

This works perfectly unless the user does not select anything from the combo box (cbStrengthSelections) but only inputs into iptAddStrength.

In this case, I would only want to display the data of iptAddStrength.

I was thinking about using an If(isBlank... but wasn't sure if that was the most efficient solution.

 

Any ideas? Thx for your consideration.

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

Hi@slhangen,

Based on the issue that you mentioned, do you want to display the iptAddStrength text only if there is no selected within the cbStrengthSelections?

Could you please tell me that how you set the Items property of the Combo Box?

Combine that with your description, I assume that the column type you fill the Combo Box is a Text type.

I have a test on my side, please take a try as below.

Set Items for cbStrengthSelections:

DataSource.TextColumn

Set Text/Default for the Label/TextInput:

If(
    IsEmpty(cbStrengthSelections.SelectedItems),
    iptAddStrength.Text,
    Concat(
        cbStrengthSelections.SelectedItems,
        TextColumn & ";" & iptAddStrength.Text
    )
)

Hope could help you.

Regards,

Qi

Best Regards,
Qi

View solution in original post

5 REPLIES 5
Drrickryp
Super User
Super User

 

With({wstrengths:'Strengths (Strengths)' & "; "&iptAddStrength.Text
       wcbo:cbStrengthSelections.SelectedItems},
   If(
       IsBlank(wcbo
        );wstrengths; Concat(wcbo; &"; "& wstrengths
                       )
    )
)

 

 

 

Thx sir, getting multiple errors.

I just want to populate label with following contents:

cbStrengthSelections (combobox with stock items) and/or  iptAddStrength (text box where user adds)

 

Thx again for your help.

Getting following error for 'Strengths (Strengths)':

slhangen_0-1611587468063.png

Not sure what this means.  I am new to the With function.

Drrickryp
Super User
Super User

I think it means PowerApps doesn't recognize your column name.

v-qiaqi-msft
Community Support
Community Support

Hi@slhangen,

Based on the issue that you mentioned, do you want to display the iptAddStrength text only if there is no selected within the cbStrengthSelections?

Could you please tell me that how you set the Items property of the Combo Box?

Combine that with your description, I assume that the column type you fill the Combo Box is a Text type.

I have a test on my side, please take a try as below.

Set Items for cbStrengthSelections:

DataSource.TextColumn

Set Text/Default for the Label/TextInput:

If(
    IsEmpty(cbStrengthSelections.SelectedItems),
    iptAddStrength.Text,
    Concat(
        cbStrengthSelections.SelectedItems,
        TextColumn & ";" & iptAddStrength.Text
    )
)

Hope could help you.

Regards,

Qi

Best Regards,
Qi

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (1,591)