cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
freedumz
Level: Powered On

Add Conditional image in a table

Hi everyone

I'd like to know if there is a way to add an image in my table depending of a value inside it

For example imagine, I have a table with the value cost which equals to expensive, so in this case, I'd like to add a image(for example sad smiley) in my table where the value expensive is associated to the line

Is there a way to do that?

And have you some advance tutorial for powerapps? Because I followed the tuto on EDX but it's only the basis of powerapps

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Add Conditional image in a table

Yes, that's correct. The data table control doesn't support images.

https://docs.microsoft.com/en-gb/powerapps/maker/canvas-apps/controls/control-data-table

In a gallery control, you can use the insert menu to add additional fields. The way to this is to select the first item in the gallery control from the designer. The first item acts as a template for all the rows that appear in the gallery. From here, you can add an image control and set the Image property to ThisItem.CostImage.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Re: Add Conditional image in a table

You can use the Visible attribute of the image like that : ValueExpenssive>X .

Super User
Super User

Re: Add Conditional image in a table

Hi @freedumz

 

One way to do this is to first upload two image files via the File > Media menu. The first image would be your sad smiley icon, and the second would be an empty placeholder image. Let's assume that these images are called SadSmiley and BlankImage.

If you now add a gallery control to your screen, go to the advanced group in the properties pane and set the items property to:

AddColumns(YourDataSource, 
           "CostImage", 
           If(Cost = "Expensive", SadSmiley, BlankImage)
)


Once you do this, you can display the "CostImage" field from within your gallery control.

Hope that helps.

freedumz
Level: Powered On

Re: Add Conditional image in a table

Thanks for your quickanswer

When I do that, I have the path of my image which appears and not the image 😕

But it's working I have blank or expensive which appears depending of the case

So apparently, it's not possible to add image in Data table? so is there a way to increase the number of showing elements in a gallery?

 

Super User
Super User

Re: Add Conditional image in a table

Yes, that's correct. The data table control doesn't support images.

https://docs.microsoft.com/en-gb/powerapps/maker/canvas-apps/controls/control-data-table

In a gallery control, you can use the insert menu to add additional fields. The way to this is to select the first item in the gallery control from the designer. The first item acts as a template for all the rows that appear in the gallery. From here, you can add an image control and set the Image property to ThisItem.CostImage.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,169)