Returning the person data from a query

Hi,

Is it possible to return meaningful person data via a query? I’m new to monday and may be attempting to handle this in the wrong manner.

In a simple query the data brought back as part of the payload within column_values is something like the following:

“{”“personsAndTeams”":[{"“id”":16491444,"“kind”":"“person”"}],"“changed_at”":"“2020-10-06T15:04:20.130Z”"}"

This is not much good in my use-case which is reporting: I want a name or email address rather than an id. Is it possible to write the query such that it returns a more useful value, or can this id be used in an additional query to return either the specific user in each case, or a list of users that could then be ‘matched’ using the id as a key?

hi @PaulCJ
If you have the personId (in your example 16491444) you can execute a query like:

query {
  users(ids: 16491444) {
    name
    email
  }
}

Which will give you name and email address. Is that where you are looking for?

Thanks Bas de Bruin, very useful.

I’m querying the monday data via an API call from within Power BI in order to match user names into fields (which is simple with Lookups and relationships in PB). And my list of users will not change frequently so your solution works well for me.

But I wonder if it is possible to retrieve all users from within a nominated board since this would allow for a dynamic user group. Any ideas?

Cheers, PaulCJ

hi @PaulCJ
I do think you will need to iterate through the JSON returned from the column_values query, I don’t believe this is possible with just one API query.

Hey @PaulCJ,

I believe @basdebruin is correct on this, one API query wouldn’t be able to account for this. However if you were to iterate through the JSON response, I believe you would be able to parse through this.

-Daniel

Cheers @dsilva, appreciate the confirmation.

1 Like