A month ago, a client asked me to make an employee survey application for an organization. I have developed the application as they desire, but we put the company logo, text, and some stuff as static, which should not be. Cause if the client takes this application and that time they wants to put their company logo and text as per their wish. So, the logo, image, and text should be dynamic every time while developing any product.
In this article, I will explain how to dynamically display image in Power Apps with two different approaches.
Dynamically Display Image in Power Apps
Let’s discuss the methods to show the images dynamically in Power Apps.
Approach – 1: [Display Power Apps images dynamically from a SharePoint List]
The first and best approach to dynamically display images in Power Apps is to use a SharePoint list or a library. We can store your image in a SharePoint list, and then you can use that image in the Power Apps application. So, let’s begin.
Here, I have a SharePoint list named Admin Options. This list has various columns with different data types. Among them, there is an Image field called Company Logo.
Now, you need to upload the image (maybe the company logo/icon) that you want to display dynamically in the Power Apps application. Also, you need to create a single item by providing only the Title field value. (Here, I have created as ITEM1). So, whenever the user wants to update the image, they can edit this item and update their desired image.
Go back to your Power Apps application and create a global variable on the App’s OnStart property as:
Set(varCompanyLogo,LookUp('Admin Options',Title="ITEM1").'Company Logo'.Full);
Where,
- varCompanyLogo = Variable Name
- ‘Admin Options’ = SharePoint List Name
- Title = SharePoint column that you want to lookup with
- ‘Company Logo’.Full = SharePoint image field name (also you can provide the image size according to your need, either small, medium, or large)
Next, add a Power Apps image control on the screen and set its Image property as the variable name.
varCompanyLogo
Finally, run the app’s OnStart property and see the changes throughout the application.
Approach – 2: [Display Power Apps images dynamically from the Media option]
Another straightforward approach is to use the Power Apps Media feature. You can directly upload the image/logo using the + Add media option, as shown below.
Then, create a variable on the Power Apps OnStart property as:
Set(varCompanyImage,'TSinfo Logo');
Where,
- varCompanyImage = Variable Name
- ‘TSinfo Logo’ = Image name that you have uploaded in the Media
Insert an image control and set its Image property to that variable name:
varCompanyImage
Always upload the image using the Media option with the same name.
Finally, run the app’s OnStart property, and you will see the changes reflected throughout the app.
So ensure that whenever you update the image, you either run on start or refresh the application to see the changes.
I hope this article finds you helpful. This way, we can dynamically display the images/logos in Power Apps.
Moreover, you may like some more Power Apps tutorials:
- Power Apps Form Validations Examples
- Power Apps Patch Attachments to SharePoint List
- Power Apps Login Page Forgot Password Feature
- Show the Current Logged In User in a Combo Box On a Power Apps Modern Form
- Show/Hide Password in Power Apps Login Page
- Add an Image to a PDF Form in Power Apps
I am Bijay a Microsoft MVP (10 times – My MVP Profile) in SharePoint and have more than 17 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com