cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
3csman
Impactful Individual
Impactful Individual

Change Image Based on Content of Field

I've got a Gallery that tracks Certs and Quals. 

 

I've added an Image field to the Gallery to represent the entity that Accredited the Cert or Qual.

 

The Image should change based on the hidden Accreditation agency name field.

 

The hidden Accreditation agency field has the following in the  

 

If(ECMmberCQTitleHtmlTxtFld_2.HtmlText = "Pro Board", 'Pro Board Icon') & If(ECMmberCQTitleHtmlTxtFld_2.HtmlText = "IFSAC", 'IFSAC Image') & If(ECMmberCQTitleHtmlTxtFld_2.HtmlText = "State", State_1, Picture1)

1 ACCEPTED SOLUTION

Accepted Solutions
FabianAckeret
Super User
Super User

Hi @3csman 

 

Since you have a gallery, you should make use of the ThisItem functionality. In your gallery, you are referring to the same field, which is ECMmberCQTitleHtmlTxtFld_2. However, since your ECMmberCQTitleHtmlTxtFld_2.HtmlText is always pointing to the same field, it won't update the image. So I'd recommend you to use ThisItem.'Accreditation agency' to fix your issue.

 

Also, this would be a great case to use the Switch Functionality instead of If, like so:

Switch(
    ThisItem.'Accreditation agency',
    "Pro Board", 'image1',
    "IFSAC", 'Image2',
    "State", 'Image3'
)

Use this formula on the Image property.


Please click Accept as Solution if my post answered your question. Like my answer? Consider giving it a Thumbs Up. Others seeking the same answers will be happy you did.

View solution in original post

1 REPLY 1
FabianAckeret
Super User
Super User

Hi @3csman 

 

Since you have a gallery, you should make use of the ThisItem functionality. In your gallery, you are referring to the same field, which is ECMmberCQTitleHtmlTxtFld_2. However, since your ECMmberCQTitleHtmlTxtFld_2.HtmlText is always pointing to the same field, it won't update the image. So I'd recommend you to use ThisItem.'Accreditation agency' to fix your issue.

 

Also, this would be a great case to use the Switch Functionality instead of If, like so:

Switch(
    ThisItem.'Accreditation agency',
    "Pro Board", 'image1',
    "IFSAC", 'Image2',
    "State", 'Image3'
)

Use this formula on the Image property.


Please click Accept as Solution if my post answered your question. Like my answer? Consider giving it a Thumbs Up. Others seeking the same answers will be happy you did.

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,691)