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 Record Selector...
Power Apps
Answered

Random Record Selector + Check if row is empty

(0) ShareShare
ReportReport
Posted on by 237

Hi, so I'm looking to automate one of my apps where normally a user would create a compound and then we get sent the necessary data in an email and we would manually go into this large compound SQL table and randomly pick a row and put in the data per the email. 

 

The SQL table is very large, so I need to use a delegation workaround

 

I found this article, which is most likely how I would approach getting the random row: http://powerappsguide.com/blog/post/get-random-record-from-datasource 

 

But the issue that remains is how do I check to see if the random row generated doesn't already have data in it? Because this table does have a lot of rows with data already in it and the last thing I want is for it to get overwritten. 

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

    Hi @bhanney2323 :

    Firstly,'First' and 'FirstN' are not delegable. I suggest you try this way:

    1\Create an int type primary key(ID) that starts from 1 and increments by 1

    2\Use this formula to get a random row

    With(
     {TheID:Int(RandBetween(1,10000))},
     Lookup(YourList,ID=TheID)
    )

    Secondly,you can use IsBlank to determine whether certain fields of this random row are empty.For example:

    1\Get The Random Row and save it into a variable 'TheRandomRow'

    Set(TheRandomRow,
     With(
     {TheID:Int(RandBetween(1,10000))},
     Lookup(YourList,ID=TheID)
     )
    )

     2\Check weather column1 is blank or not

    IsBlank(TheRandomRow.Column1)

    If Column1 is blank,then this formula will return true.

    I think this link will help you a lot:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-isblank-isempty

    Best Regards,

    Bof

  • bhanney2323 Profile Picture
    237 on at

    Thank you, that is super helpful!

     

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