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 Image/GIF Gener...
Power Apps
Answered

Random Image/GIF Generator

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi everyone,

I would like to have a randomly generated GIF in my app.

 

I would store the GIFs in a SharePoint list (or document library? not sure here).

 

Each GIF (there are 50) would have a number between 1 and 10 AND also have a "Day Tag" i.e. Monday, Tuesday, Wednesday, etc.

 

Once the users successfully fill out a form, they are redirected to another page to see the GIF and a global variable is Set to a random number between 1 and 10.

 

I would like PowerApps to look at my lookup list and get me a random picture/GIF depending on the random number generated AND the corresponding day of the week when the user fills out the form.

 

For example, I fill out the form on a Friday.

Once I successfully submit, a global variable is setup to a random number (let's say 7 in that case).

PowerApps would do a lookup in my SharePoint list for see the GIF associated to the number 7 in the RandomNumberColumn and Friday in the DayColumn.

 

I need help on

1. The formula of the image

2. The global variable to randomize the number

3. Whether I should use a SharePoint List or a Document Library

 

Thank you very much!

Categories:
I have the same question (0)
  • JayMagness Profile Picture
    1,663 on at

    HI,

     

    Try this and if you need further help will send my contact

     

    I need help on
    1. The formula of the image

    - Use a list in SharePoint, Use the Lookup Function to get the images, I would use the ID in SharePoint to lookup and set the record, then have it fill the Image control form there.
    2. The global variable to randomize the number

    -Use the Rand() Function also in PowerApps
    3. Whether I should use a SharePoint List or a Document Library

    -I would use a list and put the Gif in the attachment of each list item.

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

    Hi @Anonymous ,

     

     

    1. The formula of the image

    LookUp('Library Name', RandomNumberColumn = varRandNum && DayColumn = LookUp(colWeekday, ID= Weekday(Now())).Day)

     

    App.OnStart: ClearCollect(colWeekday, {ID:1, Day: "Sunday"},{ID:2, Day: "Monday"},{ID:3, Day: "Tuesday"},...)

     

    2. The global variable to randomize the number

    Set(varRandNum,Round(Rand(),1)*10)

    3. Whether I should use a SharePoint List or a Document Library

    Document Library!!

     

    Sik

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I think the image formula is missing the "result".

    I'm tried to add the GIF in a document library under the title column, under an image column, under a hyperlink column but nothing is working.

  • Verified answer
    v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    The GIF must be uploaded as the file. The Result of the lookup formula is:

    LookUp('Library Name', RandomNumberColumn = varRandNum && DayColumn = LookUp(colWeekday, ID= Weekday(Now())).Day).'Link to item'

    Snipaste_2020-10-07_09-20-50.pngSnipaste_2020-10-07_09-21-08.png

    Hope this helps

    Sik 

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 551

#2
WarrenBelz Profile Picture

WarrenBelz 430 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 298

Last 30 days Overall leaderboard