soql | query generator for Salesforce Object Query Language | REST library

 by   plangrid Python Version: 1.2.0 License: MIT

kandi X-RAY | soql Summary

kandi X-RAY | soql Summary

soql is a Python library typically used in Web Services, REST applications. soql has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has high support. You can install using 'pip install soql' or download it from GitHub, PyPI.

Models and query generator for Salesforce Object Query Language (SOQL)
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              soql has a highly active ecosystem.
              It has 14 star(s) with 5 fork(s). There are 63 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 0 open issues and 3 have been closed. On average issues are closed in 1 days. There are no pull requests.
              OutlinedDot
              It has a negative sentiment in the developer community.
              The latest version of soql is 1.2.0

            kandi-Quality Quality

              soql has no bugs reported.

            kandi-Security Security

              soql has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              soql is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              soql releases are not available. You will need to build from source code and install.
              Deployable package is available in PyPI.
              Build file is available. You can build the component from source.

            Top functions reviewed by kandi - BETA

            kandi has reviewed soql and discovered the below as its top functions. This is intended to give you an instant insight into soql implemented functionality, and help decide if they suit your requirements.
            • Coerce the value to a datetime object
            • Coerce the value
            • Coerce a value
            • Load a model from Salesforce data
            • Load a model from the salesforce data
            • Load models from salesforce data
            Get all kandi verified functions for this library.

            soql Key Features

            No Key Features are available at this moment for soql.

            soql Examples and Code Snippets

            Using simple salesforce to get field names for each salesforce object in a loop
            Pythondot img1Lines of Code : 4dot img1License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            api_names = ["Account", "Contact", "Campaign"]
            for obj in Api_names:
                desc = getattr(sf, obj).describe()
            
            Python memory error Save split csv python
            Pythondot img2Lines of Code : 4dot img2License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            data = sf.query_all(sosl)
            
            data = sf.query_all_iter(sosl)
            
            query a list of ids in Python via simple-salesforce
            Pythondot img3Lines of Code : 5dot img3License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            task_result = sf.query(format_soql(
                "SELECT Id, WhoId FROM Task WHERE Id = {task_id}", 
                task_id=task_id))
                
            
            How to write a for loop to dynamically call values in a function?
            Pythondot img4Lines of Code : 46dot img4License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            object_to_export = ['Opportunity','Asset']
            
            
            def sf_login():
                """
                Purpose: This function is designed to validate your Salesforce credentials and 
            create/return an instance or session.
                Note: If we have already signed in, this wil
            Convert Python XML request into Pandas Dataframe
            Pythondot img5Lines of Code : 9dot img5License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            def SOQL(SOQL):
                qryResult=sf.query_all(SOQL)
                print('Record count{0}'.format(qryResult['totalSize']))
                isDone = qryResult['done']
                if isDone == True:
                    df=pd.DataFrame(qryResult['records'])
                    df=df.drop('attributes
            How to get SalesForce data to Python Panda dataframes
            Pythondot img6Lines of Code : 7dot img6License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            from simple_salesforce import Salesforce
            sf = Salesforce(username='', password='', 
                 security_token = '')
            
            a_query= pd.DataFrame(sf.query(
                 "SELECT Name, CreatedDate FROM User")['records'])
            
            simple_salesforce python : sf.instance.bulk.query gives index error
            Pythondot img7Lines of Code : 4dot img7License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            SELECT field_1, field_2 
              FROM table__c 
             WHERE name IN (SELECT name from table__d)
            
            Simple-Salesforce query error cannot find field
            Pythondot img8Lines of Code : 2dot img8License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            s.query_all('SELECT ID, Name, MyRelationship__r.Some_Contact_Field FROM Custom_Object___c')
            
            Python Simple Salesforce Select AS Not Working
            Pythondot img9Lines of Code : 14dot img9License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            AggregateResult myResult = [SELECT count(Id) SpecialName FROM Contact];
            system.debug(myResult);
            
            DEBUG|AggregateResult:{SpecialName=1630}
            
            sf.query_all('SELECT count(Id) SpecialName FROM Cont
            Q: Simple-Salesforce make a dynamic soql query
            Pythondot img10Lines of Code : 18dot img10License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            def getObjectFields(obj):
                fields = getattr(sf,obj).describe()['fields']
                flist = [i['name'] for i in fields]
                return flist
            
            getObjectFields('Contact')
            
            sf.query_all('SELECT {} FROM Contact LIMIT 10'.format

            Community Discussions

            QUESTION

            How can jq be used to insert dynamic field names recursively for all objects in an array?
            Asked 2021-May-15 at 03:02

            'm new to jq, and hoping to convert JSON below so that, for each object in the records array , the "Account" object is deleted and replaced with an "AccountID" field which has a the value of Account.Id. Assuming I don't know what the name of the field (eg. Account ) is prior to executing, so it Has to be dynamically included as an argument to --arg.

            Contacts.json:

            ...

            ANSWER

            Answered 2021-May-15 at 02:05

            The key to a simple solution is |=. Here's one using map:

            Source https://stackoverflow.com/questions/67541549

            QUESTION

            Access a field from another table using the object relation
            Asked 2021-May-12 at 21:24

            I am new to SalesForce and SOQL so sorry in advance if the question has already been answered, if yes link it to me.

            The aim of my SOQL query is to get all the contract information to generate PDF.

            There are tables: Contract, Contact and Account

            In the Contract table there are fields: Maitre_d_apprentissage__c, MaitreApprentissageNom1__c, MaitreApprentissagePrenom1__c, Apprenti__c, ApprentiNom__c, ApprentiPrenom__c

            There are relationships:

            • Apprenti__r which link Apprenti__c to Contact table
            • Maitre_d_apprentissage__r which link Maitre_d_apprentissage__c to Contact table

            When I looked at table, I saw that MaitreApprentissageNom1__c was equal to Maitre_d_apprentissage__r.LastName and ApprentiNom__c was equal to Apprenti__r.LastName. So I conclude I could get other information of Apprenti__c and Maitre_d_apprentissage__c from the Contact Table following the same principle. So I added to my query Apprenti__r.Date_de_naissance__c and Maitre_d_apprentissage__r.Date_de_naissance__c to get the Date_de_naissance__c field which is in my Contact table.

            I see in the results that the query succeeds in getting the information but some values have changed column (lines 6 and 7), you can see the difference between query 1 and query 2. In the first query I only return the Apprenti__r.Date_de_naissance__c and in the second query I return Apprenti__r.Date_de_naissance__c and Maitre_d_apprentissage__r.Date_de_naissance__c

            Query 1:

            ...

            ANSWER

            Answered 2021-May-12 at 21:24

            It's possible that it's just your query editor displaying stuff incorrectly. You can see it got confused with 2 lookups to Contact table, why there's even a column header "Contact.Date_de_naissance__c" (and why it's there twice). And they aren't shown in the order you requested...

            What editor you're using? You could try built-in "Developer Console" or http://workbench.developerforce.com/

            What do you need it for? In Apex order of fields won't matter, in REST API query the values fetched via lookup will come as JSON sub-objects so there will always be a way to figure out exactly which value is coming from which relation.

            In Dev Console try to run this and check if it solves your fears:

            Source https://stackoverflow.com/questions/67500702

            QUESTION

            SpringML-Salesforce, cannot create xmlstreamreader from org.codehaus.stax2.io.Stax2
            Asked 2021-Apr-20 at 12:20

            I'm using https://github.com/springml/spark-salesforce to query against a salesforce api. It works fine for standard queries, but when I add the bulk options they've listed it hits the error I've listed below. Let me know if I'm making any basic mistakes, based on their documentation I believe this is the correct approach

            Trying to use a bulk query against our API. Using the below SOQL statement

            ...

            ANSWER

            Answered 2021-Apr-20 at 12:20

            This is a problem with stax2 librery add woodstox-core-asl-4.4.1.jar file in dependet jars in glue job configurarion and it will sove this error.

            Source https://stackoverflow.com/questions/67063848

            QUESTION

            LWC, set record to database soql from JavaScript with wire and Apex, error
            Asked 2021-Apr-05 at 21:11

            I try to write something to the database soql in JS, but it not works. When I click to the button 'Add to Cart' then is called handlePlaceOrder(). Here is called Apex method placeOrder('hello') with parameter String. And then it crashed "an internal server error". When I executed only Apex method placeOrder('Order01') in Developer Console, it works, writes nameOfOrder to the database.

            Here are codes:

            html (OK):

            ...

            ANSWER

            Answered 2021-Apr-05 at 21:11
            @wire(placeOrder, { nameOfOrder: '$nameOfOrder'})
            

            Source https://stackoverflow.com/questions/66953454

            QUESTION

            Using simple salesforce to get field names for each salesforce object in a loop
            Asked 2021-Apr-01 at 22:26

            I'm using simple_salesforce to get a list of all field names for an object.

            I have the following

            ...

            ANSWER

            Answered 2021-Apr-01 at 22:26

            Use getattr() to dynamically acquire an object proxy in simple_salesforce:

            Source https://stackoverflow.com/questions/66910264

            QUESTION

            Salesforce API totalSize does not always match to the number of rows returned
            Asked 2021-Mar-25 at 20:47

            I am downloading data from salesforce API. The table is big and I am using query_more to get full result. The problem is totalSize returned in result does not always match to the actual number of records returned. It can be few records less, sometimes it matches exactly.

            Is totalSize an estimation only or it should match exactly with the number of records returned? Please help to clarify this issue. Code of method returning query result:

            ...

            ANSWER

            Answered 2021-Mar-25 at 20:47

            Figured it out finally. I hope this answer will be useful for those who do not know yet how records get deleted in Salesforce.

            When record gets deleted in Salesforce, it is being put in the Recycle bin. Such records have isDeleted=true. After 15 days these records will disappear completely.

            sf_conn.query and sf_conn.query_more methods have parameter include_deleted, default False.

            By default these methods do not return records having isDeleted=True. If the job running long time, some records get deleted during execution and are not fetched. If you doing data quality checks to check that processed records count equal to fetched records count from API, better do not rely on TotalSize field and count the number of records actually fetched. See also documentation about how records get deleted in Salesforce.

            Source https://stackoverflow.com/questions/66690729

            QUESTION

            Fail to query by a SalesForce Date object using jsforce
            Asked 2021-Mar-24 at 22:52

            I'm using jsforce find-api in order to search for an account by DOB which is a field of type Date.

            The call to the API looks like this:

            ...

            ANSWER

            Answered 2021-Mar-24 at 22:47

            The mistake was a combination of treating DateTime as a Date object together with lack of examples in the documentation of jsforce.

            Finally I was able to figure it out:

            Source https://stackoverflow.com/questions/66790502

            QUESTION

            Pull values from string to assign into an array
            Asked 2021-Mar-16 at 06:02

            I've got a project where I'm pulling data from SOQL using salesforce's RestAPI. I've cleaned up the response and this is what I'm currently working with:

            ...

            ANSWER

            Answered 2021-Mar-16 at 05:39

            This can be achieved using in built PHP functions:

            explode() and array_chunk()

            Source https://stackoverflow.com/questions/66649507

            QUESTION

            Salesforce, SOQL, Developer Console, sObject is not supported
            Asked 2021-Mar-12 at 18:18

            In Developer Console in SOQL I try to select Product, but that is not possible.

            ...

            ANSWER

            Answered 2021-Mar-12 at 18:18

            The actual object's name is Product2.

            As of API version 8.0, the Product object is no longer available. Requests that contain Product are refused, and responses don’t contain the Product object.

            Here's the Entity Relationship Diagram: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_erd_products.htm

            API v8 would be ancient history, 14 years ago ;) https://gs0.salesforce.com/services/data/

            Source https://stackoverflow.com/questions/66601399

            QUESTION

            Salesforce, select from database and add to the list of Contacts
            Asked 2021-Mar-06 at 21:49

            I would like select query from SOQL, and add to the list of Contacts and return it.

            ...

            ANSWER

            Answered 2021-Mar-06 at 21:49

            I copied your code and it works like a charm? What editor you're using, maybe needs updating?

            You could simplify it to just

            Source https://stackoverflow.com/questions/66491582

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install soql

            You can install using 'pip install soql' or download it from GitHub, PyPI.
            You can use soql like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • PyPI

            pip install soql

          • CLONE
          • HTTPS

            https://github.com/plangrid/soql.git

          • CLI

            gh repo clone plangrid/soql

          • sshUrl

            git@github.com:plangrid/soql.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular REST Libraries

            public-apis

            by public-apis

            json-server

            by typicode

            iptv

            by iptv-org

            fastapi

            by tiangolo

            beego

            by beego

            Try Top Libraries by plangrid

            react-file-viewer

            by plangridJavaScript

            ReactiveLists

            by plangridSwift

            flask-rebar

            by plangridPython

            pdf-annotate

            by plangridPython

            plangrid-api-net

            by plangridC#