I need to transform data logs (created, approve, completed) from workflow history in each item (request):
into associated list columns so I can export whole list and make report with these logs like this:
Request 1 CREATED APPROVED COMPLETED
Request 2 CREATED APPROVED COMPLETED
I know I can generate workflow history list but there every event is logged as one row...
Appreciate any help.
@kyon84 ....What's the purpose of your report? Just to see which "Task" got completed when or you want to see when each and every actions of your workflow got executed?
If it's just the task then after the outcome of your task you can capture that task's information and store it in the variables and then use those variables to create list item.
If you want to create a CSV file then you can query that list and using for loop and collection operations, build the string in CSV format and using web request action you can directly save it in a document library.
Hi @kunalpatel1029 thanks for reply,
I managed to create variables and create list items however now I am experiencing another problem.
I want to calculate difference between column requested and approved. When I create item manualy it works just fine, but when I use same function for items automatically created from workflow something goes wrong...
For column diff I use Formula "TEXT(Approved-Requested,"[mm]")"
Should I change variables in WF or just something in list?
Thank you very much
@kyon84 ....Is Requested and Approved columns are Date or Single Line Text type? If they are date type and if Approved date is always greater than Requested date then you can simply create a calculated column in SharePoint and use below formula:
Make this calculated column as number type and select 0 decimal instead of Automatic.
If it's SLT then convert it to Date type and follow above steps.