Hello
Bit stuck with this one and i hope I can explain it well. I have two SharePoint lists , one is the parent list and it connects to a child list via an ID - with a one to many structure>
SharePoint List A Sharepoint List B
ID 7 |-------------------------- ID7
|-------------------------- ID7
|-------------------------- ID7
I need to display the count of the ID that occurs in the second list in a gallery that connects to the first SharePoint list
For example :
In Gallery A - I have ID 7 ( SharePoint list A) ..
Now in SharePoint list B , I may have ID 7 occurring 9 times.
How do I display the count in Gallery A next to the ID ??
Something that will look like this ...
GALLERY A
ID7 - Count: 9
-----------------
ID8 - Count:11
-----------------
ID9 - Count : 4
-----------------
I need help with the logic behind the count.
Thank you in advance
Solved! Go to Solution.
Hi @Anonymous ,
Could you please share a bit more about the data structure of your List A and List B?
Which column do you use to store the ID value of List A within your List B? Number type column or LookUp type column?
Based on the needs that you mentioned, I think the Filter function and CountRows function could achieve your needs. I have made a test on my side, please take a try with the following workaround:
Set the Items property of the GalleryA to following:
'Your List A'
Within the GalleryA, add a Label, set the Text property to following:
ThisItem.IDColumn & " - Count: " & CountRows(
Filter('List B', IDColumn_ListB = ThisItem.IDColumn)
)
Note: The IDColumn_ListB represents the column in your List B to store the ID value of your ListA. The IDColumn represents the ID column in your List A. On your side, you need to replace it with actual column name from your two SP Lists.
If the IDColumn_ListB is a LookUp type column in your List B, please modify above formula as below:
ThisItem.IDColumn & " - Count: " & CountRows(
Filter('List B', IDColumn_ListB.Value = ThisItem.IDColumn)
)
Please take a try with above solution, then check if the issue is solved.
Best regards,
Put this formula in a Textbox:
CountRows(Gallery2.AllItems,IDColumn)
If you have not already connected your galleries then do this:
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
tried it but telling me i created a circular reference ...
Kindly show a screenshot of the Gallery items of both Galleries
Hi @Anonymous ,
Could you please share a bit more about the data structure of your List A and List B?
Which column do you use to store the ID value of List A within your List B? Number type column or LookUp type column?
Based on the needs that you mentioned, I think the Filter function and CountRows function could achieve your needs. I have made a test on my side, please take a try with the following workaround:
Set the Items property of the GalleryA to following:
'Your List A'
Within the GalleryA, add a Label, set the Text property to following:
ThisItem.IDColumn & " - Count: " & CountRows(
Filter('List B', IDColumn_ListB = ThisItem.IDColumn)
)
Note: The IDColumn_ListB represents the column in your List B to store the ID value of your ListA. The IDColumn represents the ID column in your List A. On your side, you need to replace it with actual column name from your two SP Lists.
If the IDColumn_ListB is a LookUp type column in your List B, please modify above formula as below:
ThisItem.IDColumn & " - Count: " & CountRows(
Filter('List B', IDColumn_ListB.Value = ThisItem.IDColumn)
)
Please take a try with above solution, then check if the issue is solved.
Best regards,
It worked .. thanks !!
User | Count |
---|---|
196 | |
124 | |
87 | |
49 | |
42 |
User | Count |
---|---|
284 | |
163 | |
138 | |
75 | |
72 |