cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jmulvane
Regular Visitor

LookUp with a variable not working. Works when input manually

Hello PowerApp Community

 

I am setting a variable, costCenterCode, to LookUp my collection, ListOfCostCenters, to see if the code is contained within the collection.

jmulvane_0-1663752226421.png

You can see costCenterCode is 2933010, however the variable costCenter returns blank after the lookup.

When I remove costCenterCode and input "2933010" instead:

jmulvane_1-1663752374240.png

You can see, we get the desired cost center in our variable costCenter.

Can anyone see why I can't achieve the desired output from the LookUp when using the variable costCenterCode?

 

Thank you in advance!!

1 ACCEPTED SOLUTION

Accepted Solutions

Thank you!! You've made me realise I have a leading space

View solution in original post

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @jmulvane ,

The detail you have omitted is the output of

CIPComboBox.Selected.'For list’

you are setting the variable to the piece after the last "-" in the selection. You also to not need Text() as it is already a string.

Set(
   costCenterCode, 
   Last(
      Split(
         CIPComboBox.Selected.'For list’,
          "-"
      )
   ).Result
);

Thank you!! You've made me realise I have a leading space

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,317)