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 / lookup function in Pow...
Power Apps
Answered

lookup function in PowerApp has an error even when the datatypes are same

(0) ShareShare
ReportReport
Posted on by 19

Hi,

I am trying to create an app using power apps. 
I have connected the desktop application and PowerApp to read the data from google sheets. The datatype are same for column called patient_no.

 

Hi,

I am trying to create an app using power apps. 
I have connected the desktop application and PowerApp to read the data from google sheets. The datatype are same for column called patient_no.

 

NarendarYadav_4-1670927356767.png

 

I tried to combine the data by converting but it didnt work.

1. LookUp(Sheet1, Patient_No = First(PowerBIIntegration.Data), Patient_No)

2. LookUp(Sheet1, Patient_No = First(PowerBIIntegration.Data), Int(Patient_No))

3. LookUp(Sheet1, Int(Patient_No) = First(PowerBIIntegration.Data), Int(Patient_No))

4. LookUp(Sheet1, Int(Patient_No) = First(PowerBIIntegration.Data), Patient_No)

but none seems to be working.

Incompatible types for comparison.

NarendarYadav_5-1670927390113.png

 

Can anyone help me here?

I tried to combine the data by converting but it didnt work.

1. LookUp(Sheet1, Patient_No = First(PowerBIIntegration.Data), Patient_No)

2. LookUp(Sheet1, Patient_No = First(PowerBIIntegration.Data), Int(Patient_No))

3. LookUp(Sheet1, Int(Patient_No) = First(PowerBIIntegration.Data), Int(Patient_No))

4. LookUp(Sheet1, Int(Patient_No) = First(PowerBIIntegration.Data), Patient_No)

but none seems to be working.

Categories:
I have the same question (0)
  • LaurensM Profile Picture
    12,516 Moderator on at

    @NarendarYadav could you try the following adjustment:

    //With the function below you will be comparing the Patient_No fields
    LookUp(Sheet1, Patient_No = First(PowerBIIntegration.Data).Patient_No).FieldNameToDisplay

    The last .FieldNameToDisplay is optional. Remove this if you want to display it as a record in a gallery. If you want to display it in a Text Control, you will need to specify the field.


    If I answered your question, would you be so kind as to accept it as a solution.
    Thanks!

  • Verified answer
    cha_cha Profile Picture
    4,932 Moderator on at

    Hello @NarendarYadav 

     

    cha_cha_0-1670927953822.png

     

    LookUp(Sheet1, Patient_No = First(PowerBIIntegration.Data).Patient_No)
    LookUp(Sheet1, Patient_No = Value(First(PowerBIIntegration.Data).Patient_No))

    Please try the two above.

     


      ✔️
    Just in case my response helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

     

      🔗
    🕸bistek.space  🐦 @cha_bistek  📺 @BisTekSpace 

     

  • NarendarYadav Profile Picture
    19 on at

    Hi @cha_cha ,

    I tried both the suggestions and both showed errors.

    LookUp(Sheet1, Patient_No = First(PowerBIIntegration.Data).Patient_No)

    Error Message : Name isn't valid. 'Patient_No' isn't recognised.

     

    LookUp(Sheet1, Patient_No = Value(First(PowerBIIntegration.Data).Patient_No))

    Function 'Value' has invalid arguments.

  • cha_cha Profile Picture
    4,932 Moderator on at

    Can you please share what are the fields selected in the PowerBI?

  • Verified answer
    NarendarYadav Profile Picture
    19 on at

    Hi @LaurensM,

    I tried this

    LookUp(Sheet1, Patient_No = First(PowerBIIntegration.Data).Patient_No)

     Error Message : Name isn't valid. 'Patient_No' isn't recognised.

     

    LookUp(Sheet1, Patient_No = First(PowerBIIntegration.Data).Patient_No).FieldNameToDisplay

    Error Message: Name isn't valid. 'Patient_No' isn't recognised. Name isn't valid. 'FieldNameToDisplay' isn't recognised

  • NarendarYadav Profile Picture
    19 on at

    Hi @cha_cha 

    I have the selected following fields in PowerBi

    1. Patient_No

    2. Patient_Name

    3. Action_Button

  • NarendarYadav Profile Picture
    19 on at

    Thank you all. It worked.

  • NarendarYadav Profile Picture
    19 on at

    It worked but the app is really slow. Can we do anything to make it little faster ?

  • Dziubek Profile Picture
    2 on at

    @NarendarYadav  Which formula worked for you?

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 353 Most Valuable Professional

#2
11manish Profile Picture

11manish 279 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 252

Last 30 days Overall leaderboard