cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper V
Helper V

Unable to fetch the data using Lookup function

Hello All,

 

I am new to Powerapps, i have 2 datasources namely 

1. ScanData1 :  URN, InoutDate, User

2. Preregister : URN, CompanyName, Visitor Name

 

Both of them have URN as the common field.

 

I want to get the data from Preregister Database : CompanyName and VisitorName 

 

Please advice how to go about this

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Unable to fetch the data using Lookup function

Use this:

ForAll(GalleryName.AllItems, Patch('[dbo].[ScanData1]', Defaults('[dbo].[ScanData1]'),{URN: urn.Text, InOutDate: Now(), User: User().FullName, 'Visitor Name': visitornamelookup.Text, 'Company Name': companylookup.Text}); Select(BarcodeScanner1)

 

If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution

 

 

View solution in original post

17 REPLIES 17
Highlighted
Super User III
Super User III

Re: Unable to fetch the data using Lookup function

Try this:


LookUp('[dbo].[PreRegister]',urn=ThisItem.URN,CompanyName)
 
 
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution
Highlighted
Helper V
Helper V

Re: Unable to fetch the data using Lookup function

Hi,

 

I am getting error as Invalid Argument Type near equal sign

Highlighted
Super User III
Super User III

Re: Unable to fetch the data using Lookup function

Two questions:

1. Is urn in the Table Preregister?
2. Is urn a number field? If so put: Value(ThisItem.URN)

Highlighted
Helper V
Helper V

Re: Unable to fetch the data using Lookup function

Hi,

I was able to fix the issue. But however i am unable to save to the destination. Please find the attached error message.

Highlighted
Super User III
Super User III

Re: Unable to fetch the data using Lookup function

Remove the Space in the "Company Name": CompanyName

Highlighted
Helper V
Helper V

Re: Unable to fetch the data using Lookup function

I get the error as 

 

the specified column CompanyName doesn't exist.

 

My SQL Column has Company Name. 

Please find the attached screenshot

Highlighted
Super User III
Super User III

Re: Unable to fetch the data using Lookup function

Put the Company Name in single quotes 'Company Name'

Highlighted
Helper V
Helper V

Re: Unable to fetch the data using Lookup function

I was able to save the data. But however the lookup works fine in the Powerapps, but when it goes to SQL it showing wrong numbers.

 

For ex: attached URN one is abc company and visitor name is nagaraj

and other is def company and visitor name is jagadeesh

 

But SQL shows both as nagaraj and abc company only.

 

Please advice. Attached is the SQL data

Highlighted
Helper V
Helper V

Re: Unable to fetch the data using Lookup function

And also when ever i scan and save it getting added into the main table also which is not required. Please find the attached screenshot of sql

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,355)