web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Unable to fetch the da...
Power Apps
Answered

Unable to fetch the data using Lookup function

(0) ShareShare
ReportReport
Posted on by 294

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

 

 

lookup.png
Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,925 on at

    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
  • nagaraj007 Profile Picture
    294 on at

    Hi,

     

    I am getting error as Invalid Argument Type near equal sign

  • eka24 Profile Picture
    20,925 on at

    Two questions:

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

  • nagaraj007 Profile Picture
    294 on at

    Hi,

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

    saving.png
  • eka24 Profile Picture
    20,925 on at

    Remove the Space in the "Company Name": CompanyName

  • nagaraj007 Profile Picture
    294 on at

    I get the error as 

     

    the specified column CompanyName doesn't exist.

     

    My SQL Column has Company Name. 

    Please find the attached screenshot

    sql table.png
  • eka24 Profile Picture
    20,925 on at

    Put the Company Name in single quotes 'Company Name'

  • nagaraj007 Profile Picture
    294 on at

    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

    SQL ERROR.png
  • nagaraj007 Profile Picture
    294 on at

    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

    sql error1.png
  • nagaraj007 Profile Picture
    294 on at

    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.

    powerapps- sql.png

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 345 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 177

Last 30 days Overall leaderboard