cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
mdevaney
Level 8

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
mdevaney
Level 8

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 197 members 5,601 guests
Please welcome our newest community members: