cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Stuznet
Helper I
Helper I

Count Duplicate Value

Hi,

I'm still poking my way around PowerApps. 

Currently, I'm building a simple flow for user registration on SP. I'm trying to count duplicate value in the UID column where UID occurred more than once then update SharePoint in the Count column.

 

This is what I had built so far, but I'm sort of stuck. 

Capture.PNGCapture2.PNG

 

As you can see UID occurred more than once which and count = 2. 

What function or formula that I can tell flow to update the count that correlated to the UID on the SP?

 

Ultimately, this is what I want to see in the SP list.

UIDCount
A-002820192
A-002720192

 

If you have a better way, please, by all means, show me.

 

I really appreciated your help.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @AKRogers ,

Thank you for looking into this, for some reason, is returning 0. I followed this instruction and used REST api instead then parse json and get the field that I wanted. I just finished my flow and is working flawlessly. I really appreciated that you look into this. 

 

View solution in original post

4 REPLIES 4

@Stuznet 

Hi there.  I have some questions:

  • What does the original SP list look like?  (The one from the Get Items step). 
  • Is that the same SP list you are trying to update, or is there a different list?

The way I am picturing it, you have one list which is your registrations (each registration is a separate line), and then another list which keeps a count of registrations by UID, ya?

 

Let me know if that's correct and we'll go from there.

 

Keep us posted.

-Ed-

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

Hi @edgonzales ,

Yes, you're picturing correctly. Sorry for not explaining thoroughly.

I have two SP lists.

 

List1 - Registration, consist of 

  • Name
  • Course (lookup from Classroom Schedule list)
  • Date (look from Classroom Schedule List)

 

List 2 - Classroom Schedule, consist of

  • Course
  • Date
  • Max Seats
  • Registered (lookup from Registration count related)

 

The problem I cannot utilize the Registered column in the flow, it just wouldn't display.

Then it prompts me to create a UID (concatenate course and date) field in List 1. My goal is to count the duplicates UID. 

 

Hi @Stuznet,

 

I replicated your two SharePoint lists from your notes above, and I laid out the steps in a flow that I think will help you here.  Assuming that you want this to trigger every time a user registers for a course, here are the overall actions.  I'll dig in deeper after:

 

OverallCourseReg1.png

 

OverallCourseReg2.png

First, you'll compose the ID from the Course name and Course date; it looks like you had this part figured out just fine!  

 

Next, we update the current item with the new ID to set the stage for counting up the number of registrations for that ID.  To count those registrations, use a SharePoint Get Items action along with a filter on the UID:

GetItemsRegFilter_12-28-19.png

 

Then we increment a counter variable once per value that comes back from the Get Items action:

regcounter_1228-19.png

 

Once we have all those courses counted and stored in our variable, we just have to update the right Course with the new registration count.  The key to this is another Get Items with a filter on the course value that comes from the flow trigger:

 

updateCourse_122819.png

 

Try this out and let us know how it goes!

 

Ashley

 

If this response provided an answer to your question please mark it as a solution so that others can find it.

If you found this helpful, consider giving it a thumbs up!

Hi @AKRogers ,

Thank you for looking into this, for some reason, is returning 0. I followed this instruction and used REST api instead then parse json and get the field that I wanted. I just finished my flow and is working flawlessly. I really appreciated that you look into this. 

 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,478)