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

Cant search datatable for value

Hi.  Apologies for this question I am a PowerApps newbie.  Im trying to search to see if a value exists in a datatable.

My code is: If(CountRows(Filter(Table1.Column1,varScan in Table1.Column1)) > 0,"Exist","Does Not Exist")

VarScan has a code in however even if it's not in the table it comes up as Exists.  I think I have my naming's are wrong - or the search itself is completely wrong. 

I have a DataTable2.  Within that the Data Items is set to Table1.  Within that I have a column called Records - however the only way I can get a search string without errors is by using the above code. But it doesn't work. Can anyone help?

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @Bottlefury ,

Try this format

If(
   !IsBlank(
      LookUp(
         Table1,
         Column1 = varScan
      ).Column1
   ),
   "Exist",
   "Does Not Exist"
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

View solution in original post

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @Bottlefury ,

Try this format

If(
   !IsBlank(
      LookUp(
         Table1,
         Column1 = varScan
      ).Column1
   ),
   "Exist",
   "Does Not Exist"
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

you sir, are a gentleman and a scholar! works perfectly!

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.

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 (3,003)