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

Notifications

Announcements

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:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    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
    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard