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 / Prevent string loss wh...
Power Apps
Answered

Prevent string loss when list box refresh

(0) ShareShare
ReportReport
Posted on by 73

I have a list box which contain a list of item which depend on the dropdown option which user selected. For example, user select chair, my list box will contain item like wooden chair etc, user able select the item in list box and it will appear it at the label. 

My label text formula:
Left(Concat(ListBox2_1.SelectedItems,TestParameterName& ", "),Len( Concat( ListBox2_1.SelectedItems,TestParameterName& ", " ) ) - 2)

 

My problem currently is whenever user go select different dropdown option, for example user select table, the label text will reset. Is that anyway that I can keep the text and user able to continue select next item?

Categories:
  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @NeohLooi ,

     

    According to your description, I think you could try the collect() function on the onchange property of the combo box control.

     

    For example:

    Collect(Test, {Testcolumn : Left(Concat(ListBox2_1.SelectedItems,TestParameterName& ", "),Len( Concat( ListBox2_1.SelectedItems,TestParameterName& ", " ) ) - 2) } )

     

    It will save the value selected by the user.

     

    Best Regards,

    Wearsky

    If my post helps, then please consider Accept it as the solution to help others. Thanks.

  • NeohLooi Profile Picture
    73 on at

    But I can't show the collection in a label, is that any other way to show the string?

  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @NeohLooi ,

     

    You could try the following code:

    First(Test).Testcolumn // Assign the value of the first record to label
    Last(Test).Testcolumn // Assign the value of the last record to label
    Last(FirstN(Test,*)).Testcolumn // Assign the value of the *th record to label

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

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