Hello everyone,
This post is based on another issue solved with @WarrenBelz
I'm trying to migrate some data from one sharepoint list to my power app based on a selected item in a ComboBox.
In my app I've created a form based on a list call LIST1, as now the list counts with 3500 records and is basically this:
The fields base, country, location and zone are Choice type.
The app is going to be used by users all around the globe who are going to fill purchases in it.
ID | Date | Supplier | Amount $ | Base | Location | Country | Zone |
1 | 31/03/2020
| Ana | 100 | 1st street | MUN | GERMANY | EUR |
2 | 1/04/2020 | Pete | 50 | 2nd street | NYC | USA | NAM |
I have another list called Suppliers, this list holds the Supplier info and is basically this:
The fields base, country, location and zone are Choice type as well.
ID | Name | BaseS | LocationS | CountryS | ZoneS |
1 | Ana | 1st street | MUN | GERMANY | EUR |
2 | Pete | 2nd street | NYC | USA | NAM |
As you can tell is very similar to LIST1, so what I want is for the user to pick a supplier and that the fields (base,location,country,zone) are filled automatically and hidden from the user to save time and space. I'm adding a screenshot to help understanding.
For the suppliers ComboBox called Cbsuppliers I have:
ITEMS: Sort(Suppliers;Name)
For the other ComboBoxes I have the same code but with the corresponding field, for example for Base the code is:
ITEMS: Filter(Suppliers; Name = DDPROVEEDOR.Selected).BaseP
The error I´m getting is: This data type is not allowed for evaluation, data type Control.
Thanks in advance for your help
Solved! Go to Solution.
Hi @efroseroc ,
Your issue is much clearer now you have posted the table content. Firstly, Name is not a good title for a field - it is a reserved word in PowerApps - you might consider changing it.
Starting with the hidden fields - example Location control Default
Lookup(
Suppliers;
Name = Cbsuppliers.Selected.Name;
Location
)
OR
Lookup(
Suppliers;
Name = Cbsuppliers.Selected.Name
).Location
The same syntax will apply to Base, Country and Zone
I believe the drop down syntax for Base would be (depending on the Items property of DDPROVEEDOR)
Filter(
Suppliers;
Name = DDPROVEEDOR.Selected.Name
).BaseP
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi @efroseroc ,
Your issue is much clearer now you have posted the table content. Firstly, Name is not a good title for a field - it is a reserved word in PowerApps - you might consider changing it.
Starting with the hidden fields - example Location control Default
Lookup(
Suppliers;
Name = Cbsuppliers.Selected.Name;
Location
)
OR
Lookup(
Suppliers;
Name = Cbsuppliers.Selected.Name
).Location
The same syntax will apply to Base, Country and Zone
I believe the drop down syntax for Base would be (depending on the Items property of DDPROVEEDOR)
Filter(
Suppliers;
Name = DDPROVEEDOR.Selected.Name
).BaseP
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi @WarrenBelz sorry for the late reply, I was doing some testing.
Thanks for your advice and overall help.
In concordance with your answer I have this code, as you know is basically the same for all so I just picked Base.
We are really close, but the issue is that the user still has to manually pick the Base and so on, even though there is only one option in the Cb.
The old field Name is now SupName.
Default:
LookUp(
Suppliers;
SupName=Cbsuppliers.Selected.SupName
).BaseP
Items:
Filter(
Suppliers;
SupName=Cbsuppliers.Selected.SupName
).BaseP
The Items Property of CbSuppliers is:
Sort(
Filter(
Suppliers;
Activity=true)
;SupName)
Activity is a Y/N field to know which suppliers are active.
Thanks again for your help.
Hi @efroseroc ,
Why have a combo box if there is only one choice? A text input connected to the relevant field can have the same Default and simply be reset when you need to populate it.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi @WarrenBelz, thank you so much for your interest,
I had some problems with my office account so I couldn`t work in the app for a while.
About the matter in hand, I tried with a list but since the Fields (Zone,Country and Location) are not text, but choice, I get an error message.
Thank you for your help and understanding.
Thank you @WarrenBelz the issue was that I inserted the code in the wrong place.
The correct way was, as you suggested
items:
LookUp(
Suppliers;
SupName=Cbsuppliers.Selected.SupName
).BaseP
Thanks again and the best of luck!
Hi @efroseroc ,
You have accepted your own post as the solution - can you please consider correcting this.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
190 | |
70 | |
50 | |
37 | |
26 |
User | Count |
---|---|
243 | |
113 | |
91 | |
91 | |
68 |