cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jmerk
Level: Powered On

change new record datacard field based on lookup from dropdown list

I have two sharepoint lists.  The first contains an id number, name and grade of student.  I have two dropdown list for the user to select the name and grade.  Now I creating a new record on my second sharepoint list where i want the id number set in a hidden id field on the datacard.  So on the onchange of the dropdown list I am using:

 

UpdateContext(DataCardNewId: LookUp(
StudentsNames,
Grade = DropdownNewGrade.Selected.Value And Name = DropdownNewName.SelectedText.Value,
StudentID)
))

 

For some reason this is not work.  Any Ideas?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: change new record datacard field based on lookup from dropdown list

I see some minor syntax errors but I am not sure if they are the cause. I’ve added curly brackets, removed an extra round bracket and changed the DropdownNewName.SelectedText

UpdateContext(
{
DataCardNewId:
LookUp(StudentsNames,
Grade = DropdownNewGrade.Selected.Value And Name = DropdownNewName.SelectedText,
StudentID)
}
)

Some other ideas are:
Put the LookUp function in a label to check if anything is being returned.
UpdateContext only works while on one screen. Make sure you are not moving between screens or the variable will clear.

View solution in original post

2 REPLIES 2
Super User
Super User

Re: change new record datacard field based on lookup from dropdown list

I see some minor syntax errors but I am not sure if they are the cause. I’ve added curly brackets, removed an extra round bracket and changed the DropdownNewName.SelectedText

UpdateContext(
{
DataCardNewId:
LookUp(StudentsNames,
Grade = DropdownNewGrade.Selected.Value And Name = DropdownNewName.SelectedText,
StudentID)
}
)

Some other ideas are:
Put the LookUp function in a label to check if anything is being returned.
UpdateContext only works while on one screen. Make sure you are not moving between screens or the variable will clear.

View solution in original post

Jmerk
Level: Powered On

Re: change new record datacard field based on lookup from dropdown list

You were right the syntax had an error.  Now I got that fixed.  My lookup is working properly.  This is only on one screen.  However the field still doesn't update.  Error was in my data field default as well.  Thanks for your help.

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (3,407)