Ability to use JSON values retrieved from external trigger as variables in a workflow

Hi,

I am trying to use JSON file values as variables in a workflow. I am able to send the JSON in request body through an External Trigger and postman returns a 200 OK response with the JSON body in output as demonstrated in Test Workflow via External Trigger

What would be my next step if I want to use the JSON values as variables in my workflow?

My JSON file looks like this:

{
  "input" : {
    "id" : "userId",
    "accountName" : "userAccount",
    "firstName" : "userFirstName",
    "lastName" : "userLastName",
    "phone" : "userPhone",
    "email" : "userEmail"
  }
}

expecting to retrieve the values from the body as $.trigger.userId… or similar

Please advise. Thank you.

Hi @smajumdar

You can store the response in a variable using the Define Variable step in the workflow UI:

Operators - SailPoint Identity Services

If the example you’re using is indeed the trigger, then something like $.trigger.input.id is what you’d want to store in the variable step.

Let me know if that helps.

Hi Vincent,

I can only see the response of the external trigger, but unable to retrieve the contents. While defining variable, I do not get any option to choose the request body.

This is what the external trigger shows for variables:

And this is how the define variable looks like:

I am confused on how it can be extracted from the external trigger, since the external trigger does return a response on postman.

Thanks.

This is covered in the External Trigger documentation:

Triggers - SailPoint Identity Services

Basically, because anything could be in the trigger body, the workflow can’t predefine those variables, but you can still store the JSON path in the variable manually.

2 Likes

Thank you. I will review the documentation thoroughly and get back to you with any updates.

Thanks Vincent, It has worked!

1 Like

Hi @smajumdar !

Did this end up working?

Hi Vincent, it worked. Adding it as a solution.

1 Like

Awesome, glad to hear!

1 Like