Hello Everyone.
Do you want to log different actions, inputs, outputs, final status like successful, failed. Or store the start time and end time. Then this is cookbook for you.
- To get the above things for a particular action, you can use the function called Result.
- Just add a scope action. Inside that scope action put the action you want to know information about.
- Then after the scope action. Add another compose, and write in it: result('ScopeName'). [Default: result('Scope')]
- After this run the flow once. Then copy the output you are getting in the latest compose.
- After this add a parse json action in your flow. In it add the output of compose and in generate for sample just copy what you copied from the flow run.
- After this use create item to just save the data in sharepoint.
Things to not here:
- You can use the above to log errors to, just make a parallel branch, on left side continue the flow normally and on right hand side, go to configure run after of compose, and set it as when flow has failed.
- And follow the same steps after that.
Flow:

Formula below:
result('Scope')


In case of logging error:

And set it to has failed.

Output in Sharepoint:

Benefits:
Logging is a good technique to do because the run history is only available till 28 days. You can download the run history on regular basis but you can do this too. You can analyze later, at what output you were getting successful results and at what output you were getting a failed result.
You can add multiple actions in the scope and get information about all the actions that are inside it.
I hope you guys will find this cookbook helpful.
Do comment if you find any difficulty in the above method or have any doubts.
And if you like it kudos are appreciated. 🙂