Hi! I'm trying to collect a record from a selected record in a combobox with this:
Collect(PullSheetCollection, InventorySearch.Selected)
I have an entity called "Inventories" that's the source of a combobox "InventorySearch" - and I'm using a collection called "PullSheetCollection."
The issue, is when I run the collect function it's only collecting the record from the column that's displayed in the combobox - not the entire record. My collection actually has all of the columns from the entity in the combobox, but the only one getting filled is the Commercial_Name column - which is what is displayed in the combobox.
Any ideas?
Solved! Go to Solution.
After some more searching I found someone with a similar problem - I think it was a new feature added. You just have to turn off Explicit Column Selection.
Thanks to @v-siky-msft
He solved this in the original case I found.
I would use a LOOKUP formula to reference the original table and pull the record from there instead.
Collect(
PullSheetCollection,
LookUp(your_datasource_name, ID = InventorySearch.Selected.ID)
)
If this does not work the next step would be to show me the code in the Items property of the InventorySearch ComboBox.
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
@mdevaney I tried the lookup function - no errors, but it's not collection anything.
Collect(PullSheetCollection, LookUp(Inventories, Bar_Code = InventorySearch.Selected.Bar_Code))
I just have my ComboBox's items set to the entity, "Inventories"
Could you please try to REFRESH your connection by going to the left-side menu, clicking on the datasource, then Refresh? I am wondering if changes to the datasource could be the cause of both your problems.
@mdevaney I tried the refresh and it's seeing all of the columns to collect, but it's not actually collection the selected item's data.
I solved the other issue by going to an older version. I have no idea why it broke - the formula and all the arguments stayed the same.
Hmmm... can you create a label and try these in the Text property? Let me know if there is any result. For the 2nd code snippet replace "type a valid barcode here" with a known good barcode.
LookUp(Inventories, Bar_Code = InventorySearch.Selected.Bar_Code, Bar_Code)
LookUp(Inventories, Bar_Code = "type a valid barcode here", Bar_Code)
Is your datasource SharePoint? If yes, what is the column type for BarCode? (e.g. Text, Number, LookUp, etc).
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
@mdevaney The first function came up empty - which explains the issue. The 2nd came out fine.
It's a CDS data source. I actually have two Barcode columns, one is type text and the other number. I just created the text version to help troubleshoot.
CDS is not my specialty but...
Maybe what the most recent test tells us is there is a data type mismatch of some sort. Text can only be compared to Text and Numbers can only be compared to Numbers.
So its a total guess but maybe converting the information in your ComboBox to another data type will do the trick. Try this again in a label using my 2 ideas below.
LookUp(Inventories, Bar_Code = Value(InventorySearch.Selected.Bar_Code), Bar_Code)
LookUp(Inventories, Bar_Code = Text(InventorySearch.Selected.Bar_Code,"0"), Bar_Code)
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
@mdevaney This is weird. It seems like I'm unable to reference certain columns. HOWEVER, I discovered once I create a label with InventorySearch.Selected.Column - that specific column will then work in the lookup function.
It's still only collection the fields it's already seen though. For example, I have the Commercial Name field referenced in the combobox, the InStock field in another input control - those fields get collected. Once I created the label with the barcode text field, it then collected it. I then created another label with my Manufacturer field - it then collected that column.
This might be a good case to report to Microsoft - this seems like a bug.
User | Count |
---|---|
255 | |
114 | |
94 | |
48 | |
38 |