Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Different results from same formula

(0) ShareShare
ReportReport
Posted on by

I have a very weird issue. I use the following construct for the text property of a label:

If(LookUp(Filter('LCC Requests', StartsWith(gccDesc, varSelectedRFS)), empCountry = Label19.Text, Status.Value) = "New", "X", "Y")

This works perfectly fine. If the status of the first matching entry is "New", it returns "X", else "Y".

Now I want to use this construct to change the font color of some other control accordingly:

If(LookUp(Filter('LCC Requests', StartsWith(gccDesc, varSelectedRFS)), empCountry = Label19.Text, Status.Value) = "New", RGBA(0, 105, 117, 0.5), RGBA(0, 0, 0, 1))

While this is giving me the expected result and the font color changes as desired, there is an error:

The requested operation is invalid. Server Response: LCC Requests failed: The query is not valid.

I researched this, there are many posts about the issue, but I couldn't find one that would resolve this.

I can confirm that varSelectedRFS and Label19.Text are never null or empty (in which case the first construct would fail as well anyway). What could be causing this error, am I missing something?

Categories:
  • Verified answer
    Community Power Platform Member Profile Picture
    on at
    Re: Different results from same formula

    @iAm_ManCat while it is not really a solution, you put me on the right track. There's no point in checking if the variable is null, because it is never null in any context where it is being used. The app was running perfectly fine, the errors were only thrown when editing the app! 

     

    My solution: rather than setting the variable to "", set it to "_void" (or any string) so it won't ever be empty. No more errors!

  • iAm_ManCat Profile Picture
    18,206 Most Valuable Professional on at
    Re: Different results from same formula

    What happens when varSelectedRFS is blank - I would imagine this is where the issue is occurring. You can work aroudn that by including a check for blank:

     

    If(
     LookUp(
     Filter('LCC Requests',
     Len(varSelectedRFS)=0
     ||
     StartsWith(gccDesc, varSelectedRFS)
     ),
     empCountry = Label19.Text,
     Status.Value
     ) = "New", 
     "X", 
     "Y"
    )

     

    Could you try that and let me know if the error is resolved or else if there's new errors?

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 1