web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Conditional template f...
Power Apps
Unanswered

Conditional template fill based on dropdown selection

(0) ShareShare
ReportReport
Posted on by 8

Hello!

 

I am trying to change the template fill of the rows in a gallery based on their relation to a dropdown. I'm using two Sharepoint lists as databases and relating them through a field. The problem I'm facing is that, instead of changing the template fill of a specific item, all items change color based on the last input of the dropdown. Here's a sample of my code:

 

 

If(
 ThisItem.IsSelected,Color.MediumPurple,
 LookUp(
 'list',
 'topic field'=ThisItem.TopicID && Location=varSelectedLocation,true
 ) && Radio1.Selected.Value = "No",
 Color.DarkGray
 ,
 LookUp(
 'list',
 'topic field'=ThisItem.TopicID && Location=varSelectedLocation,true
 ) && Dropdown1.Selected.Value = "bad evaluation",
 Color.OrangeRed
 ,
 LookUp(
 'list',
 'topic field'=ThisItem.TopicID && Location=varSelectedLocation,true
 ) && Dropdown1.Selected.Value = "good evaluation",
 Color.LightGreen
 ,
 ...
)

 

 

Any ideas of what might be wrong?

 

Thanks!

Categories:
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @monks_ ,

     

    In 1st condition, ThisItem.IsSelected seems to apply to all items in the gallery, and thats why all items are changing color based on the last input of the dropdown.

     

    Could you please try this one -

    If(
     ThisItem.IsSelected, Color.MediumPurple,
     LookUp(
     'list',
     'topic field'=ThisItem.TopicID && Location=varSelectedLocation,
     true
     ) && Radio1.Selected.Value = "No", Color.DarkGray,
     ThisItem.DropdownValue = "bad evaluation", Color.OrangeRed,
     ThisItem.DropdownValue = "good evaluation", Color.LightGreen,
     ...
    )

     

  • monks_ Profile Picture
    8 on at

    Hello, @Anonymous!

     

    This doesn't seem to work, probably because I'm not working with a form but with independent fields that relate through a text field similar to ID (in this format: 001, 002, 003...)

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Instead of Templatefill, try to add rectangle inside gallery and use this formula on Rectangle's fill property.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 204 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard