HTTP Operation Failing with single quotes

I’m trying to make a call to graph.microsoft in a workflow step, but it fails due to single quotes I need in the filter clause.

The URL is: https://graph.microsoft.com/v1.0/directoryRoles?$filter=roleTemplateId eq ‘88d8e3e3-8f55-4a1e-953a-9b9898b8876b’

I’ve used two versions of variables. The first creates the whole URL in the “Define Variable” step like this:

{
  "name": "Create GET Url",
  "description": "Create the url string for getting the Entra role id.",
  "transforms": [
    {
      "id": "sp:transform:concatenate:string",
      "input": {
        "variableB.$": "$.loop.loopInput"
      }
    },
    {
      "id": "sp:transform:concatenate:string",
      "input": {
        "variableB": "'"
      }
    }
  ],
  "variableA": "https://graph.microsoft.com/v1.0/directoryRoles?$filter=roleTemplateId eq '"
}

Alternatively, I’ve tried using: https://graph.microsoft.com/v1.0/directoryRoles?$filter=roleTemplateId eq ‘{{$.loop.loopInput}}’

I’ll need to use a variable of some kind, but I did verify that hardcoding the URL into the step also returns the same error, which is what convinces me that the issue is the single quotes. I did see another post regarding something similar and I tried typing in the URL (not using copy/paste) but nothing has worked.

The workflow works as expected when I hardcode: https://graph.microsoft.com/v1.0/directoryRoles/a8bd263e-cbd8-40d7-b032-20f15bdd45dd

Please note, I know the role ID in the last URL is different than supplied in the other URL. Another annoyance is that IdentityNow uses the roleTemplateId for the Entra ID role instead of the actual ID, so I’m trying to fetch the id using the GET call.

Can anyone help me understand why this won’t work??

Hi @cassidiopia,

Have you tried invoking this hardcoded value from some other tool like Postman?
If yes, then please share the sample request which is being successful and steps configuration that you are using in IdentityNow.

Thanks

Hi @cassidiopia,

You must encode your url by replaceing space by %20 and " by %22

Exemple :
“variableA”: "https://graph.microsoft.com/v1.0/directoryRoles?$filter=roleTemplateId%20eq%20"yourExpectedValue"

Single cote ’ equivalent is %27 :
“variableA”: “https://graph.microsoft.com/v1.0/directoryRoles?$filter=roleTemplateId%20eq%20’

image

2 Likes

Hi @cassidiopia,

I agree with the suggestion from @baoussounda . You must encode the special characters in order to make it work but not sure if the standard workflow can do it (ideally it should but will need to test it myself).

I hope this helps.

Regards
Vikas.

1 Like

@cassidiopia another alternative can be to use an Query parameter option available from worklfow action.

With that your url will automatically encoded :

You can put the key $filter and value roleTemplateId eq ‘{{$.loop.loopInput}}’

2 Likes

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