Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

lookup error for database data source

(0) ShareShare
ReportReport
Posted on by 24

hello,

 

when I try to use lookup function for database data source It's work, but I getting the following formula error:

The requested operation is invalid. Server Reponse: TableName failed: Expression expected at position 34 in ColumnName eq '. inner exception: Expression exception: Expression expected at position 34 in Column name eq '. clientRequestId: 571ab9b3-d6e4-48fc-997b-c6c3c6b3561b

 

lookup formula that I am using at gallery item level as text in label:

LookUp(TableName, ColumnName = ThisItem.ColumnName).SomeOtherColumnName

 

do you have any idea what could be a reason for such a error?

 

Best Regards

  • RandyHayes Profile Picture
    RandyHayes 76,287 on at
    Re: lookup error for database data source

    @jacob_ 

    You might consider a conditional statement such as:

    If(!IsBlank(ThisItem.ColumnName), 
     LookUp(TableName, ColumnName = ThisItem.ColumnName, SomeOtherColumnName)
    )
  • jacob_ Profile Picture
    jacob_ 24 on at
    Re: lookup error for database data source

    that's correct first record of gallery do not have value for this attribute, what is the best practice to handle such a records via lookup function? 

     

    thank you!!

  • Verified answer
    RandyHayes Profile Picture
    RandyHayes 76,287 on at
    Re: lookup error for database data source

    @jacob_ 

    From the error message, it appears that ThisItem.ColumnName has no value.

    What is the context of your Lookup - form, gallery, etc?

  • WarrenBelz Profile Picture
    WarrenBelz 145,445 on at
    Re: lookup error for database data source

    @jacob_ ,

    I will tag colleague @RandyHayes here - I do not use SQL

  • jacob_ Profile Picture
    jacob_ 24 on at
    Re: lookup error for database data source

    azure sql (serverless), moreover  ThisItem.ColumnName (whole number) is passed from Power BI

  • WarrenBelz Profile Picture
    WarrenBelz 145,445 on at
    Re: lookup error for database data source

    @jacob_ ,

    What is your data source (SQL)?

  • jacob_ Profile Picture
    jacob_ 24 on at
    Re: lookup error for database data source

    well at the datasource level ColumnName data type is int, but OtherColumnName is varchar(3000)

  • WarrenBelz Profile Picture
    WarrenBelz 145,445 on at
    Re: lookup error for database data source

    Hi @jacob_ ,

    What type of fields are ColumnName and OtherColumnName?

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,445

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,741

Leaderboard