Workflows: How to dynamically create request body in HTTP action

How else would you send a JSON body in the HTTP Request action that has dynamic values? For example, I need to send the identity’s email address in the HTTP Post when a source account is updated. Workflows don’t support constructing a variable and I can’t add variables in the JSON body of the HTTP Request action. E.g.,

“email” : $.trigger.attributes.email

Thanks!

1 Like

Hi Daniel,

I moved this to a new topic to keep the conversations focused.

The Workflows team is working on a feature called “Variable Substitution” that will enable Workflow users to dynamically construct inputs, like the JSON body in an HTTP action. This feature is slated for release at the end of Q3, possibly early Q4.

1 Like

Hi @colin_mckibben,

Can you please confirm if this feature is already available?

If not when can we expect this? Do you have any other alternatives to have the variable substitution [Dynamic values].

Thanks in Advance.

2 Likes

Hello @colin_mckibben , is the “Variable Substitution” feature is enabled for action HTTP request.

Thanks,
Prasad

Hi Prasad. Yes, variable substitution is enabled for HTTP action, but there is a known bug that prevents it from being resolved at the moment. The engineering team is currently working on this.

1 Like

Thanks @colin_mckibben for the information !!
I tried with below JSON body but it is not working.
{
“sys_id”:“$.getIdentity.attributes.servicenowsysid”
}

Can you help me with the example for how to pass identity attribute value in JSON body?

Variable substitution requires double curly braces around the variable. Try this:

{
    “sys_id”:“{{$.getIdentity.attributes.servicenowsysid}}”
}
1 Like

Thanks @colin_mckibben,

I tried this but not working. Can you let us know about when the Engineering team is going to release the resolution?

This should be fixed now.

3 Likes

Wondering if you can confirm if this also works for HTTP inputs like this:

{{$.hTTPRequest.body.records[0].id}}

I ask because it’s not evaluating for me, however it IS evaluating when using “Verify Data Type”, and exist just prior to this.

1 Like

Good morning.

The dynamic variable references do not appear to be working on my tennant.

“lastName”:“{{$.getIdentity.attributes.lastname}}”

Is there an issue with this? i’ve even tried changing the type of curly bracket by copy and pasting from this post.

Was this ever fixed?

Welcome to the developer community Adam.

I just tried this out in my workflow and it works as expected.

Can you share more details on what is happening in your tenant? Are there any error messages? What does the output look like?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.