Get User Data

Get User Data

This guide will help you with the following:
  1. Syntax 
  2. Example 
  3. Response Format
  4. Additional Example 
    1. Round Robin Assignment 
The details about the users of an extension or vertical solution can be fetched using the zoho.crm.getRecords() deluge task.

Syntax

  1. <Response> = zoho.crm.getRecords("users", <page Long>, <perPage Long>, <userTypeMap map>);
where,
<Response> is the task response returned as a Map.

Parameters

Example

Fetch all the active users associated with an extension or vertical solution.
  1. response = zoho.crm.getRecords("users",1,200,{"type":"ActiveUsers"});
  2. info response;

Note
If in the above script, an empty map is passed for the variable userTypeMap, then all users will be fetched.
userTypeMap = Map();
response = zoho.crm.invokeConnector("crm.getusers",userTypeMap);

Response Format

  1. {"users":[{"country":null,"role":{"name":"CEO","id":"2853142000000026005"},"city":null,
  2. "language":"en_US","locale":"en_US","microsoft":false,"Isonline":false,"Modified_By":
  3. {"name":"Latha Velu","id":"2853142000000131009"},"street":null,"alias":null,
  4. "id":"2853142000001501001","state":null,"fax":null,"country_locale":"US",
  5. "first_name":"Brenda","email":"lathav.spring@gmail.com","Reporting_To":null,
  6. "zip":null,"created_time":"2019-07-30T11:26:00+05:30","Modified_Time":"2019-07-30T11:26:00+05:30",
  7. "website":null,"time_format":"hh:mm a","offset":19800000,"profile":
  8. {"name":"Administrator","id":"2853142000000026011"},"mobile":null,"last_name":null,
  9. "time_zone":"Asia/Kolkata","created_by":{"name":"Latha Velu","id":"2853142000000131009"},
  10. "zuid":"663254876","confirm":true,"full_name":"Brenda ","territories":[],
  11. "phone":null,"dob":null,"date_format":"MM/dd/yyyy","status":"active"},
  12. {"country":"null","role":{"name":"CEO","id":"2853142000000026005"},"customize_info":
  13. {"notes_desc":null,"show_right_panel":null,"bc_view":null,"show_home":false,
  14. "show_detail_view":true,"unpin_recent_item":null},"city":null,"signature":null,
  15. "name_format":"Salutation,First Name,Last Name","language":"en_US","locale":"en_US",
  16. "microsoft":false,"personal_account":false,"Isonline":true,"default_tab_group":"0",
  17. "Modified_By":{"name":"Latha Velu","id":"2853142000000131009"},"street":null,"alias":null,
  18. "theme":{"normal_tab":{"font_color":"#FFFFFF","background":"#222222"},"selected_tab":
  19. {"font_color":"#FFFFFF","background":"#00FFFFFF"},"new_background":null,"background":"#F3F0EB",
  20. "screen":"fixed","type":"default"},"id":"2853142000000131009","state":"null","fax":null,
  21. "country_locale":"US","first_name":"Latha","email":"latha.v@zohocorp.com","Reporting_To":null,
  22. "zip":null,"decimal_separator":"en_US","created_time":"2017-11-01T22:37:11+05:30",
  23. "Modified_Time":"2017-11-01T22:37:11+05:30","website":null,"time_format":"hh:mm a",
  24. "offset":19800000,"profile":{"name":"Administrator","id":"2853142000000026011"},"mobile":null,
  25. "last_name":"Velu","time_zone":"Asia/Calcutta","created_by":{"name":"Latha Velu","id":"2853142000000131009"},
  26. "zuid":"650456410","confirm":true,"full_name":"Latha Velu","territories":[],"phone":"null",
  27. "dob":null,"date_format":"MM/dd/yyyy","status":"active"}],"info":{"per_page":200,"count":2,
  28. "page":1,"more_records":false}}

Additional Example

Round Robin Assignment
Assign Leads to your users using the round robin method.
  1. lead_id = input.lead.get("Leads.ID");
  2. datamap = map();
  3. datamap.put("module", "Leads");
  4. datamap.put("id", lead_id);
  5. resp = zoho.crm.invokeConnector(("crm.get"), datamap);
  6. resp1 = (resp.get("response")).toMap();
  7. datalist = resp1.get("data").toJSONList();
  8. reqq = datalist.get(0).toMap();
  9. l_number = (reqq.get(("roundrobinleadassignment0.Lead_Number"))).toLong();
  10. rule = reqq.get(("roundrobinleadassignment0.Assign_Using_Active_Assignment_Rule"));
  11. m = map();
  12. resp = zoho.crm.invokeConnector(("crm.getusers"), m);
  13. respMap = (resp.get("response")).toMap();
  14. users = respMap.get("users");
  15. userList = users.toJSONList();
  16. userIds = List();
  17. for each user in userList
  18. {
  19.      eachUser = user.toMap();
  20.      userIds.add(eachUser.get("id"));
  21. }
  22. max_lead_level = (userIds.size()).toLong();
  23. ans = (abs((l_number % max_lead_level))).toLong();
  24. if (rule == "true")
  25. {
  26.      ownerid = userIds.get(ans);
  27.      updateMap = Map();
  28.      updateMap.put("Lead_Owner" : ownerid);
  29.      resp = zoho.crm.update("Leads",lead_id,updateMap);
  30. }

Response

  1. {"status_code":200,"response":"{"users":[{"zip":6000049,"phone":9876543210,"fax":null,
  2. "status":"active","website":"http://www.zoho.com","street":null,"state":"Tamil Nadu",
  3. "country":"in","city":"Chennai","alias_name":null,"first_name":"Zoho","timezone":"Asia/Calcutta",
  4. "zuid":"3032021", "email":"platform+demo@zohocorp.com ","dob":22.2.1993,"last_name":Demo,
  5. "time_format":null, "role":"CEO","user_id":"1297376000000094003","language":"en_US",
  6. "confirm":true,"mobile":"9500080429","full_name":"Zoho Demo ","profile":"Administrator"},
  7. {"zip":null,"phone":null,"fax":null,"status":"deleted","website":null,"street":null,
  8. "state":null,"country":null,"city":null, "alias_name":null,"first_name":"Zoho1",
  9. "timezone":"Asia/Kolkata","zuid":null,"email":"platform+demo1@zohocorp.com ",
  10. "dob":null,"last_name":"Demo1","time_format":null,"role":"CEO","user_id":"1297376000000108007",
  11. "language":"en","confirm":true,"mobile":null,"full_name":"Zoho1 Demo1","profile":"Administrator"}]}"}

    Zoho CRM Training Programs

    Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

    Zoho CRM Training
      Redefine the way you work
      with Zoho Workplace

        Zoho DataPrep Personalized Demo

        If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

        Zoho CRM Training

          Create, share, and deliver

          beautiful slides from anywhere.

          Get Started Now


            Zoho Sign now offers specialized one-on-one training for both administrators and developers.

            BOOK A SESSION








                                    You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                        Manage your brands on social media

                                          Zoho Desk Resources

                                          • Desk Community Learning Series


                                          • Digest


                                          • Functions


                                          • Meetups


                                          • Kbase


                                          • Resources


                                          • Glossary


                                          • Desk Marketplace


                                          • MVP Corner


                                          • Word of the Day


                                            Zoho Marketing Automation

                                              Zoho Sheet Resources

                                               

                                                  Zoho Forms Resources


                                                    Secure your business
                                                    communication with Zoho Mail


                                                    Mail on the move with
                                                    Zoho Mail mobile application

                                                      Stay on top of your schedule
                                                      at all times


                                                      Carry your calendar with you
                                                      Anytime, anywhere




                                                            Zoho Sign Resources

                                                              Sign, Paperless!

                                                              Sign and send business documents on the go!

                                                              Get Started Now




                                                                      Zoho TeamInbox Resources



                                                                              Zoho DataPrep Resources



                                                                                Zoho DataPrep Demo

                                                                                Get a personalized demo or POC

                                                                                REGISTER NOW


                                                                                  Design. Discuss. Deliver.

                                                                                  Create visually engaging stories with Zoho Show.

                                                                                  Get Started Now









                                                                                                      • Related Articles

                                                                                                      • Get URL

                                                                                                        The get URL Deluge task corresponds to a HTTP GET request. It is normally supported by services to perform read-only operations like fetching data from external websites. By default, it supports websites running in port 80 and 443. Syntax a. To get a ...
                                                                                                      • Data Access - Add Records

                                                                                                        This guide will help you with the following: Overview Return Syntax Things to keep in mind Applicable data-type and expression for each field Example Overview The add record deluge task creates a new record with given values in the specified form. ...
                                                                                                      • Data Access - Update records

                                                                                                        This guide will help you with the following: Overview Syntax Applicable data-type and expression for each field Things to keep in mind Example Overview The update records deluge task updates(replaces) the value of a specified field with the given ...
                                                                                                      • Data Access - Collection variable

                                                                                                        This guide will help you with the following: Overview Declaring a collection variable Aggregate functions Fetch field value from the first record Fetch values of a field from all the records in a collection Updating field value in a collection ...
                                                                                                      • Data types

                                                                                                        This guide will help you with the following: Text Number Decimal Boolean Data-time Time List Key-value Text data type The text, or string, datatype represents a sequence of characters. These characters can be text characters, special characters, ...
                                                                                                        Wherever you are is as good as
                                                                                                        your workplace

                                                                                                          Resources

                                                                                                          Videos

                                                                                                          Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                          eBooks

                                                                                                          Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                          Webinars

                                                                                                          Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                          CRM Tips

                                                                                                          Make the most of Zoho CRM with these useful tips.



                                                                                                            Zoho Show Resources