cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JR-BejeweledOne
Super User
Super User

Define Default Lookup Column Value

I have a situation where I need to use a pre-existing list with content for my power app.   It has a lookup field, but we don't need the user to select the item anymore as we can pre-set it and that is the desired configuration.

 

I am following this article:  https://powerapps.microsoft.com/en-us/blog/default-values-for-complex-sharepoint-types/

 

And am using this formula as a guide, but I want to use a variable value (it is set on app load to the correct value) where "Sales" is indicated.   I am not getting any errors, but it doesn't set the value either.

 

Example:

LookupDefaultFormula.png

 

My formula:

LookupTitleQueue.png



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
1 ACCEPTED SOLUTION

Accepted Solutions

Hi @JR-BejeweledOne ,

Do you want to set one combo box's default selected items based on one variable?

Could you tell me
1)whether you use combo box or drop down? There's no lookup drop down. You could check whether this control could choose multiple choice. Combo box can, but drop down can't.

2)what is the data type of this field that you want to set default? make sure whether it is lookup field, choice field or person field.

3)what is the data type of Manager field?
If the Manger field is person type, you should set the combo box's DefaultSelectedItems:

If(FormManageTitleQueue.Mode= New,
LookUp(Choices(TitleQueue,'Content Team',Value=varManager.DisplayName),
Parent.Default
)

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
nate_halliwell
Advocate I
Advocate I

is the form value you are trying to set the default for a ComboBox?

 

it looks like you are trying to set a default value in a ComboBox or dropdown (which is technically a Record) to a Text value (varManager) which won't work.

 

instead of setting a variable on start, set the 'DefaultSelectedItems' property of the value card (dropdown/combo box) to something like this:

 

If(FormManageTitleQueue.Mode= New,LookUp(MyListName, Microsoft365Users.MyProfileV2().id=columninMyListNamewithUserID, Department),Parent.Default)

 

Set the Items property to 

 

Choices(TitleQueue.'Content Team')

 

 

this is of course assuming that the choices in 'content team' column are directly related to the record values in MyListName.Department  

No it is not a combobox.   It is a simple lookup dropdown



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

i just tested on my end with a dropdown, and it still works. Set the Default property of the dropdown to:

 

If(FormManageTitleQueue.Mode= New,LookUp(MyListName, Microsoft365Users.MyProfileV2().id=columninMyListNamewithUserID, Department).Value,Parent.Default)

I would rather not have to do that as the variable is being set at launch for use in multiple places.   I would think that since the value of the variable matches it should work.



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

 My solution doesn't mean you can't still set your variable on App Start to use elsewhere, but it appears that your use of a Global Variable to define a default selected choice in a drop down does not work. My solution which i tested, does work though. Best of luck to you!

My apologies, I realize I left out a very important piece of information.   While the variable is titled varManager, this is NOT the users actual manager as found in the Office365Users profile.

 

varManager contains the name of the person who manages the specific content team the user is part of.   This is why I am using the variable.

 

varManager formula:

 

varManager.png

 

 



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

Hi @JR-BejeweledOne ,

Do you want to set one combo box's default selected items based on one variable?

Could you tell me
1)whether you use combo box or drop down? There's no lookup drop down. You could check whether this control could choose multiple choice. Combo box can, but drop down can't.

2)what is the data type of this field that you want to set default? make sure whether it is lookup field, choice field or person field.

3)what is the data type of Manager field?
If the Manger field is person type, you should set the combo box's DefaultSelectedItems:

If(FormManageTitleQueue.Mode= New,
LookUp(Choices(TitleQueue,'Content Team',Value=varManager.DisplayName),
Parent.Default
)

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,486)