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 / Using switch and a lookup
Power Apps
Unanswered

Using switch and a lookup

(0) ShareShare
ReportReport
Posted on by 421

Hi everyone.  Having an issue where I am trying use a lookup formula inside  switch.  The switch portion of the code works when I use it alone, and the Lookup portion works as well when its alone, just not together.  No errors at all are being shown, but it is only displaying the switch function up to the Lookup.

 

Switch(
ThisItem.Status,
"Transfer",
"This game must be received at the receiving store no later than 7/15/22",
"Sell",
"Game sale will be handled by your EAM",
"Part",
"Game will be parted and parts sent to depot NLT 7/15/22",
"Part-Out",
"Game will be parted and parts sent to depot NLT 7/15/22",
"Depot",
LookUp(
DepotStatus,
Title = ThisItem.GameName,
Column2)

 

Thanks everyone!
Chris

Categories:
I have the same question (0)
  • zmorek Profile Picture
    3,272 on at

    It might just be a relic of copy/pasting but you're missing the final closing parenthesis for the whole Switch(); for your LookUp(), what is Column2?

  • ckserra33 Profile Picture
    421 on at

    Hi @zmorek , thank you for the quick reply!  The closing parenthesis is there in the app, just missed on the copy and paste!  Column2 is what I am trying to return if ThisItem.Status = "Depot"    I added a screen shot for clarity.

     

    Chris

  • jriemsma Profile Picture
    11 on at

    But what kind of data is IN Column2.   All of the other result values are 'single line of text' (strings).  I think zmorek was asking about the 'Content Type', of Column2.  Number, Text, Date?
    Also noticed that your formula relies on the Game Name existing in the lookup table 100% of the time.  You may wish to add the optional 'default result' for the switch statement.

  • ckserra33 Profile Picture
    421 on at

    @jriemsma Got it.  It is a single line of text.  From a SP list. Thank you for the help!

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard