cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
venka91
Super User
Super User

Lookup Result based on two data fields

Dear All,

 

I am looking for proper use of Lookup function which can validate data on two columns in the share point.

 

Example, for a student record, i am trying to fetch the record from share point list based on two column namely Student ID and Year of passing. Please assist.

 

I have tried the below code, but it is not fetching the desired record.

 

Set(varStudent,

LookUp(
StudentDB,
StudentNo = (txt_Student_annual_general.Text && ACY=dd_acy.Selected.Value))

 

Here, Student No is the text input

and ACY is the Year of Passing, which is drop down list.

Based on the result, i would like to store the Record into variable, varStudent.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @venka91 ,

Firstly you have an extra bracket in there and I have to assume ACY is Text

Set(
   varStudent,
   LookUp(
      StudentDB,
      StudentNo = txt_Student_annual_general.Text && 
      ACY = dd_acy.Selected.Value
   )
)

If ACY is a number, you need this

Set(
   varStudent,
   LookUp(
      StudentDB,
      StudentNo = txt_Student_annual_general.Text && 
      ACY = Value(dd_acy.Selected.Value)
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

View solution in original post

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @venka91 ,

Firstly you have an extra bracket in there and I have to assume ACY is Text

Set(
   varStudent,
   LookUp(
      StudentDB,
      StudentNo = txt_Student_annual_general.Text && 
      ACY = dd_acy.Selected.Value
   )
)

If ACY is a number, you need this

Set(
   varStudent,
   LookUp(
      StudentDB,
      StudentNo = txt_Student_annual_general.Text && 
      ACY = Value(dd_acy.Selected.Value)
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

Oops, my bad, a single bracket made my day bad. How it was not showing any error, i am still wondering. But anyhow, your suggestion was helpful. Thank you so much.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,122)