web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Add Image in Media Lib...
Power Apps
Answered

Add Image in Media Library to a Collection

(0) ShareShare
ReportReport
Posted on by 19

I have a Sharepoint list with a Choice column "FF_Test" that has 4 values in it (Value1, Value2, Value3, Value4)

In PowerApps Media Library i have four images (Value1, Value2, Value3, Value4)

I am trying to create a form where the values from the Choice Column appear with the corresponding images

 

I have tried to create OnStart a collection using:

ClearCollect(colTest, AddColumns(Choices(Test.FF_Test), "Selected", false, "Image", Value));

 

...and display it in the gallery using ThisItem.Value or Text(ThisItem.Value) for the Image but it is still blank and doesn't display anything.

 

Any help or direction is greatly appreciated

 

Categories:
I have the same question (0)
  • Verified answer
    mdevaney Profile Picture
    29,989 Moderator on at

    @ruslank 

    I think the difficult part of what you are trying to do is match up those Choices from a Sharepoint column to an Image.  From what I can see using the Choices() function will make it difficult to do that.  Here's how I got around that problem by manually defining the Choices and their related Images.

     

    Step 1:  Load your images into the media gallery.

     

    img1.png

     

    Step 2:  Add the following code to the OnStart property of your app

     

    ClearCollect(
    	OptionsCollection,
    	{Value:"Value1", Image: Image1},
    	{Value:"Value2", Image: Image2},
    	{Value:"Value3", Image: Image3},
    	{Value:"Value4", Image: Image4}
    )

    Step 3:  Create a new gallery.  Add an Image with the Image property ThisItem.Image.  Add a Label with the Text property ThisItem.Value.

     

    img2.PNG

     

    The key here is to make sure Value1, Value2, Value3, Value4 match your Choices in Sharepoint.

     

    ---
    Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

  • ruslank Profile Picture
    19 on at

    thank you, @mdevaney  Not exactly what i was looking for. My goal was to avoid having to manage the data in both places: Sharepoint and PowerApps. 

     

    With your solution if my values were to change, i have to update them in both places. Any solution to avoid that?

  • mdevaney Profile Picture
    29,989 Moderator on at

    @ruslank 

    A Choices column does not give you any option to assoicate an image so I think it is not possible to do only in Sharepoint.

     

    Instead, my suggestion would be to change your Sharepoint column to single-line text and then control what choices the user has only from the app.  You could do this easily with the collection I provided in Step #2.  It might not be your ideal solution, but I do not see any other way to achieve control from only one program.

     

    ---

    Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

  • CindyZ Profile Picture
    on at

    @mdevaney Just a quick note to say thanks -- this was really helpful for me as I was preparing for an upcoming presentation!  

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard