Hello,
I am trying to do the following and it seems so simple but got stucked. Any help is greatly appreciated. Thanks in advance!
Solved! Go to Solution.
My thought is you are taking the correct approach but you are selecting the wrong field in your Update property. The highlighted code below is the problem.
ComboBoxPromoItemsCategory.Selected.Value
Try typing this in the Update property and wait for the auto-populate suggestion to appear. What do you see?
ComboBoxPromoItemsCategory.Selected.
Pick the option from the list that makes the most sense
---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."
Thanks for replying! There is nothing after selected. No auto-populate.
Is it possible that you are using a Dropdown instead of a ComboBox? That's what it looks like in Image4.
If you are using a dropdown control the following code should be put in the Update property of the datacard
DropdownPromoOn.SelectedText.Value
In summary, I think you are using a dropdown control called DropdownPromoOn, not a ComboBox named ComboBoxPromoItemsCategory.
---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."
Thank you for confirming that you are using a ComboBox.
The next thing I'd like to do is take a look at the data being generated by your code in Image2. Can you please do the following?
1. Place a button on the Screen temporarily.
2. In the OnSelect property of the button copy the code from your Image2. Then wrap it in a ClearCollect() funciton.
ClearCollect(tempCollect,your_code_goes_here)
3. On the top menu of PowerApps click on File. Then on the left side menu click on Collections. Then click on the collection called tempCollect.
4. Take a screenshot of the collection and post it here on the forum. This will provide more info to me.
Just to make sure; here's what I've done.
ClearCollect(TempCollect,
Switch(DropdownPromoOn.Selected.Value,
"Specific Items", Sort('[dbo].[Product_Distinct_Items]', Product, Ascending),
"Categories", Sort('[dbo].[Product_Distinct_Category]', Product_Category, Ascending),
"Sub-category", Sort('[dbo].[Product_Distinct_SubCategory]', Product_SubCategory, Ascending)))
Normally you would see a table beside the collection name. To me that's an indication there is no data to populate, usually the result of an incorrect formula.
Thanks for also posting your code. I'm looking now.
I assume this table in your database is a one-column table with the header being Product_Category?
"Categories", Sort('[dbo].[Product_Distinct_Category]', Product_Category, Ascending)
I feel like the problem could be occuring because the resulting table from your Switch statement could have 3 different column names:
"Specific Items", Sort('[dbo].[Product_Distinct_Items]', Product, Ascending), "Categories", Sort('[dbo].[Product_Distinct_Category]', Product_Category, Ascending), "Sub-category", Sort('[dbo].[Product_Distinct_SubCategory]', Product_SubCategory, Ascending)
Maybe if you renamed the resulting Table's column so that it was always the same name (myColumn) like so...
"Specific Items", RenameColumns(Sort('[dbo].[Product_Distinct_Items]', Product, Ascending), "Product","myColumn") "Categories", RenameColumns(Sort('[dbo].[Product_Distinct_Category]', Product_Category, Ascending), "Product_Category","myColumn") "Sub-category", RenameColumns(Sort('[dbo].[Product_Distinct_Category]', Product_SubCategory, Ascending), "Product_SubCategory","myColumn")
You could write this code in the Update property of your Datacard
ComboBoxPromoItemsCategory.Selected.myColumn
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
202 | |
185 | |
77 | |
47 | |
37 |
User | Count |
---|---|
325 | |
259 | |
123 | |
72 | |
58 |