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)
)