web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :

Logging of Actions in Sharepoint. [Inputs, Outputs, Final Status, Start Time, End Time], Log Errors.

Sundeep_Malik Profile Picture Posted by Sundeep_Malik 6,501

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:

 

Sundeep_Malik_0-1665477064239.png

Formula below:

result('Scope')

 

Sundeep_Malik_1-1665477080238.png

Sundeep_Malik_2-1665477154884.png

 

In case of logging error:

 

Sundeep_Malik_3-1665477282245.png

And set it to has failed.

Sundeep_Malik_4-1665477309305.png

 

Output in Sharepoint:

 

Sundeep_Malik_5-1665477415582.png

 

 

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. 🙂

 

Categories:

AI Builder topics Desktop flows

Comments

  • Sundeep_Malik Profile Picture Sundeep_Malik 6,501
    Posted at
    Logging of Actions in Sharepoint. [Inputs, Outputs, Final Status, Start Time, End Time], Log Errors.

    Hey @Anonymous 

     

    Its a little difficult to handle errors inside apply to each if it has a lot of actions. But if it has really less actions that will be possible.

     

    So what you can do is make a logging list in sharepoint first. 

    Now you will have to focus on the actions which can result on failure or that fail very often.

     

    Lets say in the below picture I know my "compose 2" fails most of the times so I can add a parallel branch and use create item to log the particular error.

     

    Sundeep_Malik_0-1708409512913.png

    Sundeep_Malik_3-1708410014056.png

     

     

     

    Now if there are a lot of actions, you can use a scope for it. Something like below:

     

    Sundeep_Malik_2-1708409803159.png

     

    If you have any other doubts you can reply below or personally message me as well on this platform itself.

    I hope this helps 🙂

     

  • Community Power Platform Member Profile Picture Community Power Pla... Microsoft Employee
    Posted at
    Logging of Actions in Sharepoint. [Inputs, Outputs, Final Status, Start Time, End Time], Log Errors.

    I have an apply to each loop that loops through cases. If an action fails for a particular case, I want to update that case's status as Failed. Is there a way to know that for which item of the apply to each, the error occurred?