![]()
πΉ Using Icons and Images in Power Apps β A Complete Guide
π Introduction
Icons and images play a crucial role in making a Power Apps application visually appealing, user-friendly, and easy to navigate. Power Apps allows you to use built-in icons, upload images, and dynamically fetch images from data sources.
β Why Use Icons & Images?
- π¨ Enhances UI/UX with visual elements.
- π Improves navigation with intuitive icons.
- π Dynamically updates images from databases or APIs.
πΉ Step 1: Adding Built-in Icons
Power Apps provides a library of built-in icons like search, delete, edit, and more.
β Adding an Icon
1οΈβ£ Go to Insert β Select Icons
2οΈβ£ Choose an icon (e.g., Search, Edit, Delete, Home)
3οΈβ£ Resize and position the icon as needed
β Customizing Icon Properties
- Change Color
Icon1.Color = RGBA(0, 122, 255, 1) // Blue Color
- Change Size
Icon1.Width = 50
Icon1.Height = 50
- Change Visibility
Icon1.Visible = User().Email = "admin@company.com"
π This makes the icon visible only for admins!
πΉ Step 2: Adding Images to Your App
β Uploading an Image
1οΈβ£ Click Insert β Select Image
2οΈβ£ In the Image Property, click Add Image File
3οΈβ£ Select an image from your computer
π Now, the image appears in your app!
β Setting an Image Dynamically from a URL
- If images are stored online, use the
Imageproperty:
Image1.Image = "https://www.example.com/myimage.png"
π Now, the image will load from the web!
πΉ Step 3: Using Images from a Data Source
β
Example: Displaying a Userβs Profile Picture from SharePoint or Dataverse
1οΈβ£ Connect to a data source (e.g., SharePoint, Dataverse, SQL Server).
2οΈβ£ Bind the image control to the image field in your data source:
Image1.Image = LookUp(UserProfileTable, Email = User().Email).ProfilePicture
π This fetches the userβs profile picture dynamically!
β
Example: Showing Product Images in a Gallery
1οΈβ£ Add a Gallery β Select a Data Source with images.
2οΈβ£ Insert an Image Control inside the Gallery.
3οΈβ£ Set the Image property to:
ThisItem.ProductImage
π Now, each product displays its own image!
πΉ Step 4: Using Icons for Navigation
β
Example: Adding a Home Button
1οΈβ£ Insert a Home Icon
2οΈβ£ Set the OnSelect property:
Navigate(HomeScreen, ScreenTransition.Fade)
π Now, clicking the icon returns to the Home Screen!
β
Example: Adding a Delete Button with Confirmation
1οΈβ£ Insert a Trash Icon
2οΈβ£ Set the OnSelect property:
If(
Confirm("Are you sure you want to delete this item?"),
Remove(DataSourceName, ThisItem)
)
π Now, clicking the icon deletes an item after confirmation!
πΉ Step 5: Displaying Images from OneDrive or SharePoint
β
Example: Displaying an Image from OneDrive
1οΈβ£ Store images in OneDrive
2οΈβ£ Get the image URL and store it in a database
3οΈβ£ Set the Image property:
Image1.Image = "https://onedrive.live.com/embed?resid=" & ThisItem.ImageURL
π Now, the image loads from OneDrive!
β
Example: Fetching an Image from SharePoint
1οΈβ£ Store images in a SharePoint Library
2οΈβ£ Use a Gallery and bind the image field:
Image1.Image = ThisItem.FileLink
π Now, SharePoint images are dynamically displayed!
πΉ Step 6: Using Conditional Formatting on Icons & Images
β Example: Changing Icon Color Based on Status
- If a task is complete, show a green check; otherwise, show red:
Icon1.Color = If(ThisItem.Status = "Complete", Green, Red)
π Now, icons dynamically change color based on the task status!
β Example: Displaying Different Images Based on Conditions
If(
ThisItem.Type = "Admin",
"https://example.com/admin.png",
"https://example.com/user.png"
)
π Now, different images are shown for admin and regular users!
πΉ Step 7: Optimizing Performance When Using Images
β Use Small Image Files
- Upload compressed images to prevent slow loading.
β Use Cached Images
- Store frequently used images in Power Apps Media Library.
β Lazy Load Images
- Load images only when needed to improve app speed.
If(Gallery1.Selected, Image1.Visible = true, false)
π This prevents unnecessary image loading!
πΉ Conclusion
Using icons and images in Power Apps helps in improving the UI, navigation, and user experience.
π‘ Key Takeaways:
β
Use built-in icons for navigation and actions.
β
Upload custom images or fetch them from data sources.
β
Bind images dynamically to galleries and lists.
β
Implement conditional formatting for dynamic UI.
β
Optimize performance by caching and lazy loading images.
Now, youβre ready to enhance your Power Apps with icons and images!
