Showing results for 
Search instead for 
Did you mean: 
Helper I
Helper I

Change Icon Color based on Inserted Number Value by user connected to excel data source

Hi Experts,


Really appreciate your help on this.


Got a quick question - I have created a survey based on the below excel data source (attached chart). Is there a way to connect:


1. First page: When dropdown menu selected value = 1, Annual volume number value input = 700 which is > 500 (from excel data source)--> clicks submit and leads to second page with icon changes to green light/if lower than 500 changes to red light


And same goes for when selected value = LOB 2 or 3 and with respective total volume from excel data source 


Please let me know if there's any solutions to make this work! Thanks!


Excel data source:



First page:


When click 'submit' button, it will link to second page.


Second page:




Accepted Solutions

@aurora12234 If you click on the code with the Red lines, it will tell you what the error is. Can you share a picture of that.

View solution in original post

Super User
Super User

@aurora12234 Place this in the Fill property of the round icon,

Replace the control and column name with your names.


      varOldAnnualVolume:Value(LookUp(yourDataSource, LOB=LOBDropdown.Selected.Value).TotalVolume)
    If(varNewAnnualVolume>varOldAnnualVolume, Green, Red)


@CNT Thanks so much for your help. Could you please advise what varNewAnnualVolume and varOldAnnualVolume are referring to? What should I input for var______?

@aurora12234 varNewAnnualVolume and varOldAnnualVolume are just variables to hold these values temporarily.


The changes you'll have to make to the formula I had sent earlier are:

AnnualVolumeTextBox - Put the name of your TextInput here

yourDataSource - Put the name of your Excel Table here

LOBDropDown - Put the name of the LOB Dropdown


Hope this helps!

@CNT Got it. Thanks for your help. Had to make several changes to survey - LOB and Commodity type are cascading dropdowns. I'd like icon color to change based on sales tail qty (excel data source) for each commodity type.


Here's what I've typed in (with errors)



Excel data source:





@aurora12234 To debug this, lets break it up.

Put the LookUp part of the Code in a Label and see of it is fetching the correct 'Sales Tail Qty' for the selected Commodity.

@CNT Still doesnt seem to work 😞


(varOldAnnualVolume:Value(LookUp(Table1,Commodity=Dropdown1_1.Selected.Result).'Sales Tail Qty'))
If(varNewAnnualVolume>varOldAnnualVolume, Green, Red)

@aurora12234 Just put ONLY code this in a Label and check if you are able to see the correct 'Sales Tail Qty' for the selected Commodity. Test this separately.


LookUp(Table1,Commodity=Dropdown1_1.Selected.Result).'Sales Tail Qty'

@CNT yes its working in a label!

@aurora12234 That's great. Now could you tell me where exactly where you putting the full code? In which control, in which property?

Helpful resources

PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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 (1,536)