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 / Random text from Excel...
Power Apps
Unanswered

Random text from Excel column at push of the button

(0) ShareShare
ReportReport
Posted on by 3

Hello everyone,

 

im new in  PowerApps so I need little help.

 

I want to make an easy App that on the press of the button will give me a random text in "Text Label" from first Excel Column1 and after it should show description of this same word from column1 that is described in second column.

 

I connected my Excel table to a data in PowerApps (picture in attachment). Name of the table is "Table1" and first column name is "Word" and second column is "Description".

 

Tried with help of an chatGPT but unsuccessfully and it says CountRows are not working

On Button --> Set(selectedValue, Lookup(Table1, Rand() * CountRows(Table1), Word))

On Text Labe --> selectedValue

 

I tried with Set(varName,"Marko") and that works with one value.

 

Thank you,

Best regards

pppic.jpg
Categories:
I have the same question (0)
  • Hassan_SZ_365 Profile Picture
    542 on at

    Hi @streamg88 ,

    To display a random text and its corresponding description from Excel columns on the press of a button in PowerApps:

    Button's OnSelect Property:

     

    Set(selectedValue, LookUp(Table1, Rand() * CountRows(Table1), Word))

     

    This formula sets the selectedValue variable to a random value from the "Word" column in your Excel table.

    Text Label's Text Property:

     

    selectedValue & ": " & LookUp(Table1, Word = selectedValue, Description)

     

    This formula displays the selected random value along with its corresponding description from the "Description" column.

    Ensure that the variable selectedValue is global so that both the button and the text label can access it.

     

    Best Regards,

    Hassn Raza

  • streamg88 Profile Picture
    3 on at

    Thank you for fast reply.

     

    I tried it now, and I get this error on Text Label "Error. Error while trying to retrieve data from the network." and it says CountRows are not supported with yellow triangle on the button. Im actually from Europe so i needed to change colon to semi-colon.

    error.jpg

     

    How do you set selectedValue as global? Maybe this is problem

     

    It's a bit weird, because if I put "Combobox" it show me the data from my excel table so i dont think the problem is at my network.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard