cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Nielsen_Carrie
Frequent Visitor

Setting Default Values based on the previous gallery selection for a Drop Down in a New Form

Hi,

 

I am creating an app where one of my teammates can click a project and view or add open action items. I am having trouble passing the "Project" and "Sub Project" values to the drop downs in the New Form. My data source is a SharePoint list and the drop downs read as Choices([@'SharepointList'].Projects). 

 

How do I pass the values from the previous gallery into those drop downs?

7 REPLIES 7
mdevaney
Super User
Super User

@Nielsen_Carrie 
Put this code in the Text property of a label as a Test and see if the value selected on the previous screen is showing.

Gallery1.Selected.Projects.Value

 

If the above code works, put this code into the Default property and it should work.

Gallery1.Selected.Projects

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

eka24
Super User
Super User

You can set a variable OnVisible of the Screen:
Set(MyItem,GalleryName.Selected.Project)

 

Then in your droddown Default put: MyItem

 

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

Hi,

 

So it isn't a label. This is a dropdown part of a new form.

@Nielsen_Carrie 
I'm aware it is not a label.  I simply recommended you put it in a label to test and make sure the value is coming through.

 

Then you can apply the code I supplied to the dropdown. 

It is showing in the label, but it will only show for the first gallery. So basically I have two sharepoint lists and the value i'm trying to pass is a lookup value in list 2 from list 1. The first gallery is connected to sharepoint list 1 and the second gallery is connected to sharepoint list 2. 

 

 

@Nielsen_Carrie
I think it would help my understanding if you could share a sample of the SharePoint lists and provide an example of what the output should be.

Yea. So there is a bigger issue. The gallery isn't filtering for whatever reason and thus will not pass the value. The 1st Gallery is one sharepoint list and the 2nd gallery is another. I'm trying to filter the 2nd Gallery based on a selected value in the 2nd sharepoint list that is a look up column.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

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