cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
silaman
Resolver I
Resolver I

Default Selected Items of a Datacard Combo box, set lookup to load from previous screen.


I am trying to use this to make a combo box for a DataCard auto select the value from a previous window, but I can't seem to figure it out, even though there are no errors, it does nothing.


DataCardValue6
DefaultSelectedItems

 

 

LookUp(DrawingRegisterParts, ProjectGlobalCode.GlobalCode = varDrawingSelected)

 

 

 

 


I have two dataverse tables, DrawingRegister and DrawingRegisterParts. The DrawingRegisters primary column is called GlobalCode

Drawing register parts connects to the Drawing register via a lookup column called, ProjectGlobalCode. Which connects to GlobalCode as mentioned. The varDrawingSelected above holds the GlobalCode from the previous selection, for use in the Lookup for adding a part.

To add a part, you first select the drawing, then I have an add part button that goes to the form for the Drawing register parts screen, I want the ProjectGlobalCode datacard combo box to have already set the GlobalCode from the previous selection.

So far I've only been able to make the hint text show the GlobalCode to make it easier for users to search it themselves, but obviously it would be better to have it loaded in.

I recently came across this trick from another post from ages ago, but I still can't seem to get it right in my instance.

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @silaman ,

 

If the previous selection is selected from the DrawingRegisters table like in a Gallery, please try and change the variable varDrawingSelected to the whole record:

Select(Parent);Navigate(Screen2,ScreenTransition.None,{varDrawingSelected:ThisItem})

 

In the Combo box DefaultSelectedItems property, use the variable with nothing else. 

vjefferni_0-1666257539695.png

vjefferni_1-1666257623690.png

 

The reason is, for Dataverse LookUp columns, they will hold exact the record(s) from the main table. So, it's easy to pre-populate the default selected item using the entire record you selected from the main table.

 

Best regards,

 

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

2 REPLIES 2
v-jefferni
Community Support
Community Support

Hi @silaman ,

 

If the previous selection is selected from the DrawingRegisters table like in a Gallery, please try and change the variable varDrawingSelected to the whole record:

Select(Parent);Navigate(Screen2,ScreenTransition.None,{varDrawingSelected:ThisItem})

 

In the Combo box DefaultSelectedItems property, use the variable with nothing else. 

vjefferni_0-1666257539695.png

vjefferni_1-1666257623690.png

 

The reason is, for Dataverse LookUp columns, they will hold exact the record(s) from the main table. So, it's easy to pre-populate the default selected item using the entire record you selected from the main table.

 

Best regards,

 

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Wow thanks a lot

It didn't quite work to begin with, but I added this on the end to make it work correctly, as opposed to what I had originally

 

 

Navigate(
    EntryPartRegisterFormDataverse,
    ScreenTransition.Fade,
    {varDrawingSelectedRec: ThisItem}

 

 


I also changed the var I was using to varDrawingSelectedRec, as I was using the earlier var elsewhere as well, and for those things it was working.

But it's all working correctly now

Thankyou

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,857)