Filter for http request when value to be filtered with is inside array

Hey,

I’m using HTTP Request to fetch entries that contain certain username under UnattendedRobot-array, but I can’t get the $filter right.

Below is the structure of unfiltered response:

What I’m looking for is to get UserName under Unattended robot (line 51) instead of the UserName in line 8

Now the filter looks like this and it returns response based on the line 8 UserName-value:
“Contains(UserName,'”+in_Username+“') and Type eq ‘DirectoryRobot’”

I’ve tried the following as a filters: “Contains(UnattendedRobot/UserName,'”+in_Username+“') and Type eq ‘DirectoryRobot’”

“UnattendedRobot.Contains(UserName,'”+in_Username+“') and Type eq ‘DirectoryRobot’”

I’m using HTTP Request Wizard and these are parameters I use:
Content-Type
Authorization
X-UiPath-OrganizationUnitId
$count
$filter

Without the filter parameter response contains all the entries, so filter is only thing that’s off. Of course if I need $expand parameter etc. please let me know!

Can someone tell me how to filter with UserName under UnattendedRobot?

Hi!

Take a look at this site to read up on odata and filters:
Basic Tutorial · OData - the Best Way to REST

You could try something like “$select=unattendedRobot/username”

we would recommend on

  • starting RnD on Swagger
  • porting the results / findings to the Orchestrator HTTP Request

When doing Experiments in Swagger also try

  • using expand for nested / navigation objects/properties
  • replace contains by alternates like IndexOf …

Hey,

Thank you for your response, this was the right solution!

I’ve a follow-up question:

When I found the correct UserName under UnattendedRobot, I realized, I would need the Id (line 48) from upper level as well.

Is there any way to get that to response as well?

Take a look at the site I linked you to.

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