hello.
I have two Sharepoint lists - a Master List and a Detail List. The Detail List has a Link Field that references the Master List's ID. I had wanted to show the number of detail rows in a summary view of the Master List.
I want to use the expression
CountIf(LabVisitDetails, ThisItem.ID=LabVisitDetails.LabVisitMasterID)
to set a label in a gallery.
But powerApps studio marks the equals sign in my formula as an error. The error message is "Invalid argument type" . I've tried various comparisons in place of "=", but to no avail.
Is there some special syntax, or a member of either term in the equals test that I should use here?
Solved! Go to Solution.
Is LabVisitMasterID a numeric column or a Lookup? I am assuming when you say "Link Field" you are talking about a "Lookup Column".
If it is a lookup column, then you need your syntax to look like this:
CountIf(LabVisitDetails, LabVisitMasterID.Id=ThisItem.ID)
I believe I may myself have found out how to do this. The Master List is the data in the Gallery, and the Detail List is to provide a Count of Visit Details for informational purposes.
The problem was as I surmised earlier due to a failure to reference the correct Member of the Link Field.
CountIf(LabVisitDetails, LabVisitDetails[@LabVisitMasterID].Id = ThisItem.ID)
In this version, I use the full reference to the Link Field In LabVisitDetails (LabVisitDetails[@LabVisitMasterID]) and then reference the Id member of the Link Field. This gets tested against ThisItem.ID. The CountIf runs, and emits the expected number of detail records
Is LabVisitMasterID a numeric column or a Lookup? I am assuming when you say "Link Field" you are talking about a "Lookup Column".
If it is a lookup column, then you need your syntax to look like this:
CountIf(LabVisitDetails, LabVisitMasterID.Id=ThisItem.ID)
I believe I may myself have found out how to do this. The Master List is the data in the Gallery, and the Detail List is to provide a Count of Visit Details for informational purposes.
The problem was as I surmised earlier due to a failure to reference the correct Member of the Link Field.
CountIf(LabVisitDetails, LabVisitDetails[@LabVisitMasterID].Id = ThisItem.ID)
In this version, I use the full reference to the Link Field In LabVisitDetails (LabVisitDetails[@LabVisitMasterID]) and then reference the Id member of the Link Field. This gets tested against ThisItem.ID. The CountIf runs, and emits the expected number of detail records
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 | |
174 | |
62 | |
32 | |
31 |
User | Count |
---|---|
329 | |
268 | |
104 | |
72 | |
56 |