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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / lookup function in Pow...
Power Apps
Unanswered

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard