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 formula for cho...
Power Apps
Unanswered

Lookup formula for choices field

(0) ShareShare
ReportReport
Posted on by 186

I have an edit form with student_id, email and phone_preference.

The student_id autopopulates from another form. If it is an existing student_id, then the email and phone_preference needs to get populated from the sharepoint file. Email address is just text so the lookup formula is sufficient. But phone_preference is a choices field, so I tried this formula but it gives an error.

 

//Choices([@SharepointFile].Phone_Preference)
If (
IsBlank(Choices([@SharepointFile].Phone_Preference)),
LookUp(SharepointFile,id=DataCardValue2.Text).Phone_Preference,
Choices([@SharepointFile].Phone_Preference)
)

Categories:
  • Anchov Profile Picture
    1,986 on at

    What is the error you are getting?  You may try using IsEmpty() instead of IsBlank() if you are getting a data type error:

    //Choices([@SharepointFile].Phone_Preference)
    If(
    IsEmpty(Choices([@SharepointFile].Phone_Preference)),
    LookUp(SharepointFile,id=DataCardValue2.Text).Phone_Preference,
    Choices([@SharepointFile].Phone_Preference)
    )

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

    Cheers!
    Rick Hurt

  • dataverse Profile Picture
    186 on at

    I get the error where datacardValue109 is the phone_preference field.

    dataverse_0-1673985571843.png

     

  • SMurphy Profile Picture
    105 on at

    Try adding .Value after phone preference. 

  • dataverse Profile Picture
    186 on at

    if I comment the Lookup part of the formula , the error goes away.

  • dataverse Profile Picture
    186 on at

    I still get the same error after adding .value

    If(
    IsEmpty(Choices([@SharepointFile].Phone_Preference)),
    LookUp(SharepointFile,id=DataCardValue2.Text).Phone_Preference.Value,
    Choices([@SharepointFile].Phone_Preference)
    )

     

  • dataverse Profile Picture
    186 on at

    Please let me know.

  • WarrenBelz Profile Picture
    156,940 Most Valuable Professional on at

    @dataverse ,

    Cutting though the issue here - the Choices() property of a Choice field will never be blank unless you have not put any in, then it will always be blank, so why do you need to test it ? If it is a Lookup field (which are largely a waste of time with Power Apps), just test the field it is looking up in the other list as you will get the same result.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard