cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

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
Highlighted
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
Highlighted
Anonymous
Not applicable

Re: Add Conditional image in a table

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

Highlighted
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.

Highlighted
Helper II
Helper II

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?

 

Highlighted
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
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (4,824)