Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 7aXOqEXf6Dye1AnzDotkYB
Power Apps - Building Power Apps
Answered

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

Like (0) ShareShare
ReportReport
Posted on 13 Dec 2022 10:31:13 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.

  • Dziubek Profile Picture
    2 on 01 Mar 2023 at 01:09:10
    Re: lookup function in PowerApp has an error even when the datatypes are same

    @NarendarYadav  Which formula worked for you?

  • NarendarYadav Profile Picture
    19 on 16 Dec 2022 at 05:33:42
    Re: lookup function in PowerApp has an error even when the datatypes are same

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

  • NarendarYadav Profile Picture
    19 on 16 Dec 2022 at 05:32:00
    Re: lookup function in PowerApp has an error even when the datatypes are same

    Thank you all. It worked.

  • NarendarYadav Profile Picture
    19 on 16 Dec 2022 at 05:23:01
    Re: lookup function in PowerApp has an error even when the datatypes are same

    Hi @cha_cha 

    I have the selected following fields in PowerBi

    1. Patient_No

    2. Patient_Name

    3. Action_Button

  • Verified answer
    NarendarYadav Profile Picture
    19 on 15 Dec 2022 at 12:04:10
    Re: lookup function in PowerApp has an error even when the datatypes are same

    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

  • cha_cha Profile Picture
    4,909 Super User 2025 Season 1 on 15 Dec 2022 at 12:01:18
    Re: lookup function in PowerApp has an error even when the datatypes are same

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

  • NarendarYadav Profile Picture
    19 on 15 Dec 2022 at 11:59:01
    Re: lookup function in PowerApp has an error even when the datatypes are same

    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.

  • Verified answer
    cha_cha Profile Picture
    4,909 Super User 2025 Season 1 on 13 Dec 2022 at 10:40:22
    Re: lookup function in PowerApp has an error even when the datatypes are same

    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 

     

  • LaurensM Profile Picture
    12,510 Super User 2025 Season 1 on 13 Dec 2022 at 10:40:02
    Re: lookup function in PowerApp has an error even when the datatypes are same

    @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!

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,513 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,692 Most Valuable Professional

Leaderboard
Loading started