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 Apps
Answered

Button Text Change

(0) ShareShare
ReportReport
Posted on by 789

Hello Everyone,

 

I want to change a text property of a gallery button to Complete if the concatenated text is equal 5 concatenated DisplayNames

 

I am using the below expression for my Button Text

If(Office365Users.MyProfileV2().displayName in Label45.Text, "In Progress", "Pending")

 

I am using the below expression for concatenation

Concat( Filter( SPList, Column1 = ThisItem.Column1 && Column2 = ThisItem.Column2 && Column3.Value = ThisItem.Column3.Value ), If( IsBlank(Column4) || Len(Trim(Column4)) = 0, "", Column4 & ";" ) )

 

I hope the information I provided helps

Categories:
  • NPPlatform Profile Picture
    606 Moderator on at

    What exactly is the problem you're having? Do the functions not behave as you expect them to? There is no question in your description. If you let us know what your question is, we're better able to help you.

  • Caleb62881177 Profile Picture
    789 on at

    Hi @NPPlatform , Sorry for confusion.

    I would help with with changing the text of a gallery button from either "Pending" or "In Progress" to "Complete" when the concatenated text of Column4 is equal to 5.

    I hope this clears things up.

  • SpongYe Profile Picture
    5,909 Super User 2026 Season 2 on at

    `hi @Caleb62881177 

     

    Try this:

    If(
     Office365Users.MyProfileV2().displayName in Label45.Text &&
     Len(Trim(Concat(
     Filter(
     SPList,
     Column1 = ThisItem.Column1 &&
     Column2 = ThisItem.Column2 &&
     Column3.Value = ThisItem.Column3.Value
     ),
     If(IsBlank(Column4) || Len(Trim(Column4)) = 0, "", Column4 & ";")
     ))) = 5,
     "Complete",
     If(Office365Users.MyProfileV2().displayName in Label45.Text, "In Progress", "Pending")
    )
    

     

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

  • Caleb62881177 Profile Picture
    789 on at

    Hi @SpongYe , I tried your solution and the "Complete" condition is only met when I change "=" to "<"

  • SpongYe Profile Picture
    5,909 Super User 2026 Season 2 on at

    Hi @Caleb62881177 

     

    My code above checks if the concatenated text of Column4 equals 5. If it does, it sets the button text to Complete. Otherwise, it follows your original condition to set the button text to either In Progress or Pending. If the Complete condition is only met when you change = to <, it seems like the concatenated text of Column4 is less than 5.

     

    Modify the code as follows:

    If(
     Value(Concat( Filter( SPList, Column1 = ThisItem.Column1 && Column2 = ThisItem.Column2 && Column3.Value = ThisItem.Column3.Value ), If( IsBlank(Column4) || Len(Trim(Column4)) = 0, "", Column4 & ";" ) )) < 5,
     "Complete",
     If(Office365Users.MyProfileV2().displayName in Label45.Text, "In Progress", "Pending")
    )

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

  • Caleb62881177 Profile Picture
    789 on at

    Hi @SpongYe,

     

    I am getting an error message saying "The value DisplayName cannot be converted to a number." and blank concatenated text Button Text Completed instead of Pending.

  • mmbr1606 Profile Picture
    14,629 Super User 2026 Season 1 on at

    hey @Caleb62881177 

     

    you can try somthing like this:

     

    You need a clear method to concatenate these DisplayNames. Assuming you have them in a collection colDisplayNames, the expression might look something like:

    Concat(colDisplayNames, DisplayName & ";")
    

     

    Button text property:

    If(YourConcatenatedStringFromSPList = lblConcatDisplayNames.Text, "Complete", 
     If(Office365Users.MyProfileV2().displayName in Label45.Text, "In Progress", "Pending"))
    

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

  • Caleb62881177 Profile Picture
    789 on at

    @mmbr1606 -  Is the expression below used in my screen OnVisible property

    Concat(colDisplayNames, DisplayName & ";")
  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    Hi @Caleb62881177 again thanks for the message but you have three super users here who should be able to answer the question. Unfortunately I cannot understand what you're trying to do. 

     

    As with your other post, it would help if you:

     

    • Share an example of what you're data looks like
    • The result you're expecting
  • Caleb62881177 Profile Picture
    789 on at

    Hi @Amik , 

     

    I have 5 columns inside a gallery of the columns is a button inside the gallery and I want to change the text of the button depending on how many DisplayNames is concatenated in Column5.

    Example:

     

    Column1         Column2          Column3        Column4(Button)    Column5

    DisplayName   DisplayName   Category2       Pending                 0 Concatenated DisplayNames

    DisplayName   DisplayName   Category2        In Progress            1 Concatenated DisplayNames

    DisplayName   DisplayName   Category2        In Progress            2 Concatenated DisplayNames

    DisplayName   DisplayName   Category2        In Progress            3 Concatenated DisplayNames

    DisplayName   DisplayName   Category2        Completed             5 Concatenated DisplayNames

    DisplayName   DisplayName   Category2        Completed             5 Concatenated DisplayNames

    DisplayName   DisplayName   Category2        Completed             6 Concatenated DisplayNames

     

    I hope this clears up any confusion

    @mmbr1606 @SpongYe  @NPPlatform 

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard