Trying to create a collections based on a specific field value
Galdcp selects a specific record from a SharePoint list
I want to create a collection from a "child" SharePoint list that has Galdcp ID as one of its field values. looks like I'm referencing the ID correctly but the Goal filed is bulling in all the rows, not just the one for the selected ID. What am I missing?
ClearCollect(colfaitems,KYOJDCPFocusAreas;{DCP:galdcp.Selected.ID,Goal:KYOJDCPFocusAreas.Goal});
All I should be getting are the bottom 3
Thx
@BCBuizer - that worked! Thank you
Hi @ctedesco3307 ,
Instead of using the Value function, select the Value column for the DCP record:
ClearCollect(colfaitems,Filter(KYOJDCPFocusAreas, DCP.Value = galdcp.Selected.ID));
To fix this issue, you could try using the Value function to get the underlying value of the lookup field. Here's an example of how you could modify your formula to do this:
The Value function returns the underlying value of the lookup field, which should allow you to compare the two values without any issues.
@JohnM86 Thanks - closer - but now I get an error at the = sign - Incompatible types for comparison These values can't be compared Record number
DCP in KYOJDCPFocusAreas is a lookup field. I'll mess around with it a bit. thx
ClearCollect(colfaitems,Filter(KYOJDCPFocusAreas, DCP = galdcp.Selected.ID));
It looks like you are using the semicolon (;) to separate the two arguments of the ClearCollect function, which is causing the second argument ({DCP:galdcp.Selected.ID,Goal:KYOJDCPFocusAreas.Goal}) to be interpreted as a separate statement instead of an additional record to include in the collection.
To fix this, you can use the comma (,) instead to separate the two arguments, and then use the Filter function to retrieve only the items from the child SharePoint list that have the selected Galdcp ID:
This should create a collection called "colfaitems" that includes all items from the "KYOJDCPFocusAreas" SharePoint list where the "DCP" field matches the ID of the selected item in the "galdcp" gallery. The "Goal" field of each item should be included in the collection as well.
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional