Trimble Connect User Forum

 View Only

 Managing TRIMBLE CONNECT projects . Export xls with Projects and Users at once

David JOSEPH's profile image
David JOSEPH posted 10-05-2023 23:46

Hi everyone,

It seems that, actually, it's not possible ... but if someone at Trimble can do something for that ;) ... i'll appreciate :)
i'd like to export xls with Projects and Users at once (an xls with all projetcs includind all users and roles)

Actually, it's not possible

image.png.14f62404dd615ed9b2e5efea73ba16b0.png
BR
David

Diego Ortega's profile image
Diego Ortega

Hi David,

We extract project information using the Trimble API in Python, iterate over projects, and append user info to a pandas dataframe. Ex:

projects = trb.get_projects() #Get project info 
AllUserInfo = []
for project in projects: #Iterate projects
    users = trb.get_project_users(project["id"]) #Get users
    allUsers.append(data) #Append data

df = pd.DataFrame(allUsers)
df.to_excel("user_list.xlsx") 

Regards,

David JOSEPH's profile image
David JOSEPH

Hello @Diego Ortega,


Thanks for the reply, cool ... but how is the link made from trimble connect?

BR
David

Diego Ortega's profile image
Diego Ortega

For use the API you need the credentials, you can get it from Trimble Connect support :

Next, introducing and logging your credentials with postman you can get an access token to make requests in python, for more details check AuthGuide.

When you have an access token with python request library, you can use endpoints from TrimbleAPI,

For example, to get all information about your projects where token variable is "access_token [token generated by postman]":

This response of the requests:

Finally, you convert dataframe to excel and get the report by projects of all user. For my case, we also want information about the groups of each user is included. So we request the groups by project Id and add this information.

David JOSEPH's profile image
David JOSEPH

Hi @Diego Ortega

Thanks a lot for this very complete answer !
the suggestion to TRIMBLE to add this possibility directly in the administration area is still valid :D 

BR
David