cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nagaraj007 Helper III
Helper III

Re: Unable to fetch the data using Lookup function

Hi,

 

Could you please help me on the issue. I have used lookup value from different table and saving all the fields to one table in SQL. 

But the problem is Powerapps shows correct data once i scan it, however when i check in SQL table it shows wrong data. 

I have attached 3 screensnips in one attachement.

One is formula of powerapps

two is main table from where the lookup is happening

third is the final data coming from powerapps.

 

Please advise.

eka24 Community Champion
Community Champion

Re: Unable to fetch the data using Lookup function

What is the formula for visitor lookup
nagaraj007 Helper III
Helper III

Re: Unable to fetch the data using Lookup function

Hi,

 

I have used the below formula for sending the data to SQL

 

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

 

I am able to get the lookup data in app but once i click save button using the above formula, its not saving the correct data.

eka24 Community Champion
Community Champion

Re: Unable to fetch the data using Lookup function

Please in the last reply, i asked that you show the lookup formula

Try this:

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

 

Are the unknown records part of some records in the table or completely unknown

 

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

nagaraj007 Helper III
Helper III

Re: Unable to fetch the data using Lookup function

Hi ,

 

I have attached formula of both saving to sql and also lookup formuala.

 

I have used the patch function and its not working. Please advise.

eka24 Community Champion
Community Champion

Re: Unable to fetch the data using Lookup function

Are you patching from a Gallery or a form. If a gallery the formula may not be the same.
nagaraj007 Helper III
Helper III

Re: Unable to fetch the data using Lookup function

Patching from gallery

eka24 Community Champion
Community Champion

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

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Top Solution Authors
Top Kudoed Authors
Users online (6,388)