I want the user when selecting an item from the gallery to show the item in that combobox
My gallery and the properties on "OnSelect":
My code on "OnSelect":
Set(varMode;"Edit");;Set(varIDMCONS;ThisItem);;Navigate(Screen3....)
And the combobox I wanna to show the items:
My code on the combobox:
Items:
NameOfMyCollection.TheColumnName
DefaultSelectedItems:
If(varMode="Edit";LookUp(MySharePointList; CUSTOMER = COMBOBOX1.SELECTED.CUSTOMER);"")
The varMode is simple: If is "Edit", he edit the item, if is "New" he create the item and if "View", he just view the item
Solved! Go to Solution.
Hi @Gorilla_8
DefaultSelectedItems based on the items property
Your Items property is
NameOfMyCollection.TheColumnName
Then DefaultSelectedItems property will be
If(
varMode = "Edit";
LookUp(
CollectionName;
ColumnName = GaleriaMercadoConsumo.Selected.ClienteSemLookUp
);
Blank()
)
To illustrate, here is an example. I have a collection like
ClearCollect(ColCustomers, {Name: "Stalin", ID:10}, {Name: "Sam", ID:2})
Items property of Combo box is
ColCustomers.Name
DefaultSelectedItems is
LookUp(ColCustomers, Name="Sam")
I hope this helps you.
Thanks,
Stalin - Learn To Illuminate
Hi @Gorilla_8
I assume you are filtering based on the previous screen selection.
Set the DefaultSelectedItems property to
If(varMode="Edit";LookUp(MySharePointList; CUSTOMER = varIDMCONS.CUSTOMER);Blank())
Thanks,
Stalin - Learn To Illuminate
Thank you very much!
Now I got the data, but he doesn't show on my combobox, see:
The type is: text
My code:
If(
varMode = "Edit";
LookUp(
T_mercado_consumo;
ClienteSemLookUp = GaleriaMercadoConsumo.Selected.ClienteSemLookUp
);
Blank()
)
Hi @Gorilla_8
DefaultSelectedItems based on the items property
Your Items property is
NameOfMyCollection.TheColumnName
Then DefaultSelectedItems property will be
If(
varMode = "Edit";
LookUp(
CollectionName;
ColumnName = GaleriaMercadoConsumo.Selected.ClienteSemLookUp
);
Blank()
)
To illustrate, here is an example. I have a collection like
ClearCollect(ColCustomers, {Name: "Stalin", ID:10}, {Name: "Sam", ID:2})
Items property of Combo box is
ColCustomers.Name
DefaultSelectedItems is
LookUp(ColCustomers, Name="Sam")
I hope this helps you.
Thanks,
Stalin - Learn To Illuminate
One more quick question about this...
if my Items is
Distinct(NameOfMyCollection;TheColumnName)
Or
Choices (NameOfMyCollection;TheColumnName)
How I show the value on combobox?
Hi @Gorilla_8
Sort(Distinct(NameOfMyCollection;TheColumnName);Result)
Or
Choices (NameOfMyCollection.TheColumnName)
Thanks,
Stalin - Learn To Illuminate
Hi @Gorilla_8
In Dataverse for Teams, by default, we will use fluent UI controls, the Combo box of which would act a bit differently. What you have discovered is that it does not support displaying "Results" from the Distinct function.
To solve this issue, we could use the classic Combo box by enabling classic controls in settings:
Thanks,
Stalin - Learn To Illuminate
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
193 | |
69 | |
49 | |
47 | |
19 |
User | Count |
---|---|
248 | |
126 | |
84 | |
75 | |
74 |