Calculate the number of times a choice variable is used

%3CLINGO-SUB%20id%3D%22lingo-sub-2383717%22%20slang%3D%22en-US%22%3ECalculate%20the%20number%20of%20times%20a%20choice%20variable%20is%20used%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2383717%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20%22Status%22%20column%20that%20is%20manually%20updated%20by%20the%20users%20throughout%20the%20process%20as%20the%20process%20moves%20forward.%3C%2FP%3E%3CP%3E%26nbsp%3BOne%20status%20%3D%20'Rejected'%20and%20they%20want%20to%20be%20able%20use%20this%20status%20at%20any%20point%20in%20the%20process%20AND%20also%20track%20how%20many%20times%20this%20particular%20status%20was%20applied.%3C%2FP%3E%3CP%3EIs%20it%20possible%20to%20use%20a%20calculated%20column%20to%20track%20that%20(i.e.%20the%20number%20of%20times%20a%20particular%20choice%20item%20was%20saved)%20or%20is%20there%20another%20way%20to%20implement%20this.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20for%20example%20I%20am%20at%26nbsp%3B%22Status%20C%22%20but%20the%20Team%20want%20to%20push%20back%20so%20select%20%22Rejected%22.%3C%2FP%3E%3CP%3EThe%20person%20responsible%20will%20pick%20up%20the%20item%2C%20fix%20it%20and%20move%20back%20to%20Status%20C.%3C%2FP%3E%3CP%3EThen%20it%20comes%20back%20and%20there%20is%20another%20issue%20the%20Team%20want%20to%20reject%20it%20again%20and%20also%20want%20to%20highlight%20the%20number%20of%20times%20now%20they%20have%20had%20to%20reject%20the%20item%2C%20in%20this%20case%20twice.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20any%20ideas!%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2383717%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ELists%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2383744%22%20slang%3D%22en-US%22%3ERe%3A%20Calculate%20the%20number%20of%20times%20a%20choice%20variable%20is%20used%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2383744%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1062690%22%20target%3D%22_blank%22%3E%40markikav1955%3C%2FA%3E%26nbsp%3Bone%20way%20to%20do%20it%20would%20be%20to%20have%20a%20JSON-formatted%20button%20in%20your%20list%20that%20the%20project%20team%20would%20click%20when%20they%20want%20to%20reject%20an%20item.%26nbsp%3B%20You%20would%20also%20have%20a%20column%20in%20your%20list%20for%20the%20number%20of%20times%20each%20item%20was%20rejected.%20The%20button%20triggers%20a%20flow%20in%20Power%20Automate%20that%20would%20update%20the%20list%20item%20and%20increment%20the%20number%20of%20times%20rejected%20column%20for%20that%20item%20by%201.%20If%20you%20need%20specifics%20about%20any%20of%20this%20just%20shout.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERob%3CBR%20%2F%3ELos%20Gallardos%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%20color%3D%22%23006400%22%3EMicrosoft%20Power%20Automate%20Community%20Super%20User%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2383791%22%20slang%3D%22en-US%22%3ERe%3A%20Calculate%20the%20number%20of%20times%20a%20choice%20variable%20is%20used%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2383791%22%20slang%3D%22en-US%22%3EHi%20Rob%3CBR%20%2F%3EYes%20specifics%20would%20be%20great.%3CBR%20%2F%3EThey%20are%20using%20an%20InfoPath%20form%20for%20data%20entry%20presently%20so%20could%20the%20button%20be%20presented%20on%20such%20form%3F%20If%20not%20its%20ok%20I%20can%20tell%20them%20if%20rejecting%20something%20just%20use%20the%20list%20view.%3CBR%20%2F%3EThanks%20for%20the%20help..%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi 

I have a "Status" column that is manually updated by the users throughout the process as the process moves forward.

 One status = 'Rejected' and they want to be able use this status at any point in the process AND also track how many times this particular status was applied.

Is it possible to use a calculated column to track that (i.e. the number of times a particular choice item was saved) or is there another way to implement this.

 

So for example I am at "Status C" but the Team want to push back so select "Rejected".

The person responsible will pick up the item, fix it and move back to Status C.

Then it comes back and there is another issue the Team want to reject it again and also want to highlight the number of times now they have had to reject the item, in this case twice.

 

Thanks for any ideas! 

5 Replies

@markikav1955 one way to do it would be to have a JSON-formatted button in your list that the project team would click when they want to reject an item.  You would also have a column in your list for the number of times each item was rejected. The button triggers a flow in Power Automate that would update the list item and increment the number of times rejected column for that item by 1. If you need specifics about any of this just shout.

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

Hi Rob
Yes specifics would be great.
They are using an InfoPath form for data entry presently so could the button be presented on such form? If not its ok I can tell them if rejecting something just use the list view.
Thanks for the help..

@markikav1955 InfoPath, if it even works with modern SharePoint lists, is no longer supported.

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

Hi Rob
That is fine, so is this possible solely through Power Automate or does it need some json too in the list?
Thanks
Mark
Create a new list column in SharePoint to store count number. you can make hidden in edit and new list form as required. Trigger a Power Automate on list item created / Updated. Then update that counter field. No more json will require by this way. Try to update list field by calling rest Api so that you need to updated only one field. In the flow trigger conditions mention your user account so it will not stuck into the infinite loop. Generally we use a different account/ service account to trigger and update list items.

Thanks
Shobhit