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:
My formula:
Solved! Go to Solution.
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,
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
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.
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:
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,
User | Count |
---|---|
250 | |
248 | |
81 | |
45 | |
30 |
User | Count |
---|---|
340 | |
261 | |
122 | |
64 | |
58 |