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 / Change Icon on gallery...
Power Apps
Answered

Change Icon on gallery item depending on previous form submissions.

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I'm trying to change an icon on a gallery item representing information in one table depending on form entries for another table and running into 'This formula uses scope, which is not presently supported for evaluation.'

 

The gallery displays a list of projects from a project table, and the form links to a list of updates for those projects in a project update table.  When the projects are updated by the current user for this week in the gallery, I want the checkmark to be visible.

 

I used a complex if statement, and while it doesn't throw a syntax error, I do get the scope error of death.  I put the formula on the Visible option for the icon itself and is as follows:  

 

If(ThisItem.Name in 'Project Updates'.Project, true, false)
And If(currentUser.FullName in 'Project Updates'.'Created By'.'Full Name', true, false)
And If(DateAdd(Today(),6-Weekday(Today(),1),Days) in 'Project Updates'.'Week Ending', true, false)

 

The weird thing is that the last if statement evaluates correctly, the middle one does not evaluate correctly, and the first throws the scope error of death.  

 

Any help would be much appreciated.

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Anonymous 

    Too complicated.  A visible property will either be true or false.  Your conditions reduce to 

     

     

    !IsBlank(ThisItem.Name in 'Project Updates'.Project)&&
    !IsBlank(currentUser.FullName in 'Project Updates'.'Created By'.'Full Name')&&
    !IsBlank(DateAdd(Today(),6-Weekday(Today(),1),Days) in 'Project Updates'.'Week Ending')

     

    Each condition will reduce to true or false implicitly.  Combining them requires all of them to be true for the icon to unhide. There is no need for an If() or the "true, false"'s assuming each element is true by itself.  

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you so much for the response, but that is exactly what I'm hoping for.  I want all of the tests to evaluate to true for the icon to show up.  The problem is, the first one throws the scope error.

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Anonymous 

    I don't know about the datasource used in your gallery and how it is filtered but if your are testing whether there is a row that contains a value for "Name" in the filtered dataset, then  !IsBlank(ThisItem.Name) should be sufficient to test whether there is a "Name" in the row.  If you are seeing whether "Name" exists in a dataset outside of the row, you will need !IsBlank(Lookup(anotherdataset, Name = ThisItem.Name))

    Second, "Name" is a reserved word in PowerApps and may be causing some ambiguity.  You should avoid using reserved terms to name your columns.  See https://powerusers.microsoft.com/t5/News-Announcements/The-Ten-Commandments-of-SharePoint-in-PowerApps/ba-p/848842  #5

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    That throws an error also, unfortunately.  I really do appreciate your help on this.  I know it is a complicated problem.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I think we are misunderstanding each other.  I'm using data verse for my data tables.  I'm trying to match the column/row value in one table to a column/row value in another table in my database.  If it is true, display the icon on the item in the gallery.

  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    You would use lookup() like !IsBlank(Lookup(anothertable , Name = ThisItem.Name))

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    It did not work until I refreshed everything.  Thank you so much for your help!

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Anonymous 

    Glad to help. You had me going there!

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard