skip to Main Content

Is there any way to retrieve the action names within the try block? I need to obtain these action names and create a string with them separated by commas. How can I achieve this?

Tried the below but not working

@actions('Try').actions

2

Answers


  1. If your aim is to list all previous actions (and extract the result), try this code in your catch block:

    result('Try')
    

    The result() function returns the results from the top-level actions in the specified scoped action. This also contains the names of the actions.

    Login or Signup to reply.
  2. You need at least 2 actions for this.

    Firstly, you need to use the Select action to get the names of the actions within the "Try" block as an array:

    Outputs of Select

    You should be selecting @item()?['name'] from @result('Try').

    Code View of Select

    Secondly, you need to transform the array to a comma-separated string. You can use the join function for this: @join(body('Select'), ',')

    Outputs of Compose

    Code View of Compose

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search