Post

2 followers Follow
0
Avatar

Get only the requested value back from related entities API V2

I have a API query against the projects entity that has returns several related entities, i.e. LastUpdatedBy which is the User Entity, so using it like lastupdatedby.username.  This returns an object instead of just the username.  I am pulling this data from MS PowerAutomate and using the ParseJSON command.  So when you have 4 User type fields (CreatedBy, LastUpdateBy, ProjectManager and ProgramManager the return from the Parse Json Command looks like

SYSID
Name
ID
Username
ID
UserName
ID
Username
ID
Username

As you can see there is nothing that Identifies that the first username value is for CreatedBy. 

Has anyone figured out how to get around this? 

Milockwood Answered

Official comment

Avatar

Hello,

As I understand the Clarizen API does return you each nested value under the relevant project field. For example:

Request: 

/data/query?q=select CreatedBy.username, ProjectManager.username FROM Project

Response:

 "CreatedBy": {
                "id": "/User/5qzoas0xbitnyvshlcxmc14680",
                "username": "sam.hupert"
            },
 "ProjectManager": {
                "id": "/User/5qzoas0xbihe756lcxmc14680",
                "username": "sam.hupert"
            }

So the issue is parsing this response in a better way?

Elad Franklin
Comment actions Permalink

Please sign in to leave a comment.

2 comments

0
Avatar

Elad,

I just figured out how to do this yesterday with the Power Automate tool.  You can use an expression to get the value, i.e. item().ProjectManager.username

Thanks,

Mike Lockwood

Milockwood 0 votes
Comment actions Permalink