You need to edit the "change the behavior of a single task".
Then tap into the "When a task completes" section. Inside this, you have to explicitly set the "Content Approval Status" to Approved\Rejected\Denied (For SPO only)
Source article here
This issue may be caused by insufficient users’ permissions. Please check whether users have enough permissions.
You could try to create a workflow with elevated permissions.
Create a workflow with elevated permissions by using the SharePoint workflow
SharePoint 2013 workflow app step and app permissions
There is no OOB way to meet your requirement using workflow.
Consider using some code, as described below:
Instead of deleting file and than restoring it back, it would make more sense to remove this file from library after Approval. If you don't want to display the file just create a column e.g. PendingForDeletionApproval and filter the View based on that. Once it is approved you can remove from Library as well as recycle bin if needed.
Now to answer your issue ...
Made the change. The flow worked until it got to the final action "Set variable - varDaystoRenewal". The 'Set variable-varDaystoRenewal' value is DIV(sub(ticks(utcNow()), ticks(items('Apply_to_each')?['DteofCQ'])), 864000000000) and currently return '198' in the value field of the 'Yes' condition.
Per my test, the powershell works fine in my farm.
To be safe, please test again with farm account who has full control on all lists.
I've gotten the flow to work. However, it shows every line with a date as 'Certified'. None are shown as 'Compliant' or 'Noncompliant'. I am providing screenshots of the flow.
Flow Image 1
Whether all workflows unable to run in this site? What is the type of this site?
Is there any error message?
Please check ULS logs for further troubleshooting.
You could refer following article to debug workflows.
I believe I have found the problem and am posting a follow-up just in case anyone runs into this same problem in the future. I made a backup copy of the workflow15.actions4 file and left it in the same folder with a different name but the same file extension. I believe SharePoint reads any files with that extension in that folder regardless of the name. So ...
I have seen you have already solved, hoever, for completeness, if you want to do a full clean-up, follow these steps:
1)Leave WFM/SB Farm
2) Uninstall updates and application in the following order and one at a time:
Service Bus CU1
Workflow Manager CU1
Service Bus 1.0
Workflow Manager 1.0
Workflow Manager Client 1.0
Microsoft Windows Fabric
Log into SQL ...
I assume using Power Automate will be more handy to you. Two flows will be enough handling you task. One is to fill in the counter column with a auto increment variable. One is to reset the counter once a year.
There is type of flow called schedule flow which you can easily set it to run once a year at a certain time so this part is very easy.
In order to get this to work, you will need to store two numbers:
The current value of the auto-increment number
What year that auto-increment number is from (because you will need to check - if it's a new year, you need to reset the auto-increment number)
The way that I have gotten this to work most effectively is by storing those numbers as properties on ...
I'm a huge fan of Flow (PowerAutomate) so if you're up for it, you could:
Trigger flow on list item creation
Get list items & ID the highest value
Use a compose or variable to pull in the current year
Concat & update item
It's a little bit of parsing work, but shouldn't be a huge flow.
Seeing a number of similar requests for calculated column, which at times turns into a complex formula. Using MS Flow, it can be solved easily.
Let's first simplify the logic for the formula:
if(DteofCQ=null) then "Noncompliant"
if(Title="Driver I" OR Title="Officer I" OR Title="Inspector I") then "Certified"