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 / Different results from...
Power Apps
Unanswered

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:
I have the same question (0)
  • iAm_ManCat Profile Picture
    18,228 Most Valuable Professional on at

    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?

  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    @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!

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 793 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard