Questions tagged [query]

A query is an inquiry into the database using the SELECT statement. A query is used to extract data from the database in a readable format according to the user's request.

Filter by
Sorted by
Tagged with
0
votes
1answer
21 views

Accessing query result fields

I am trying to pull values from a query result I'm performing on the Product2 sObject and am trying to save the values from the query into individual variables. My query result: |DEBUG|...
1
vote
2answers
38 views

How to check if user has permissions to create specific object

Given User.Id, how do I check with SOAP if this user has permission to create Contact or Lead? Update: So far I've discovered only this solution: SELECT ProfileId FROM User WHERE Id='...
0
votes
1answer
27 views

Tips for using SQL skills efficiently in Automation Studio [closed]

As a Marketing Cloud marketeer I really see queries as very powerful in creating strong segments. So, I've dived into SQL and query writing using codeacademy and w3schools, but even though I find ...
0
votes
0answers
11 views

Salesforce BULK 2 unsorted result of CSV query

I want to ask regarding BULK API 2.0 Query/data downloading through workbench and postman. Scenario I am downloading salesforce data in form of CSV. Query i am executing is "SELECT Id,Name,...
0
votes
1answer
29 views

Query: Deduplicate results (from _Click data view query)

I'm trying to add click on a certain alias to a data extension for segmentation purposes, but I find my query erroring with the 'Violation of PRIMARY KEY constraint. Cannot insert duplicate key.' ...
0
votes
1answer
22 views

Adding contacts and leads to a DE and receive a Violation of PRIMARY KEY constraint error message when running query

I'm attempting to add leads and contacts into a DE from a synced data extension that receives contacts and leads when a quiz is completed. The quiz can be taken multiple times which is why there is a ...
0
votes
1answer
34 views

Query all contacts and get emails instead of only sub keys

I found this link Can I query to all contacts in contact builder and it was very helpful but it only returns the subscriber keys. I want to query emails for duplicates since contactkeys - there are ...
0
votes
2answers
40 views

Query Studio Issue: Getting Email Addresses of All Auto Suppression List Subscribers

I am trying to get the email addresses of all subscribers of a specific Auto Suppression list. However, the issue is that the name of the column containing email addresses has a space i.e "Email ...
0
votes
1answer
25 views

How to modify two similar queries to optimize my code

I have two queries that are similar except there's a few differences between them. I was wondering if there's a way to optimize this, by querying this once and still do what I want with my code. The ...
1
vote
1answer
30 views

How to modify semi-join and anti-joins

I have similar code to this where I want to store the values of a query from a semi-join and anti-join. I want to store the values in a list respective on whether if its a semi-join or anti-join. But ...
0
votes
1answer
19 views

Filter Object Queries Based On Profile Name

So, as the title says, I would like to find all the records of an object that have been created by OR are only visible by a certain profile. Here is a query I have tried SELECT Id, Subject, ...
1
vote
1answer
41 views

Visualforce Remoting: Parameter length does not match remote action parameters: expected 1 parameters, got

Just configured a new methode in a visualforce page trying to write a variable (ID) from the VisualForce page to the Apex Controller. Console is providing me the following error Visualforce Remoting:...
3
votes
3answers
67 views

Uncaught ReferenceError: Record ID (X) is not defined in VisualForce Page (RemoteAction)

I'm currently finishing an Apex controller which gathers data for a Google chart displayed on a Visual Force Page. The standard Query without the WHERE clause is just working fine for all the data ...
0
votes
1answer
21 views

Case when in Query studio

I am trying to count customer and non-customer in my master-DE. Having a customerID means he is an customer. SELECT SUM(CASE WHEN a.customerID is not null THEN 1 ELSE 0 END) AS 'Customer', SUM(CASE ...
0
votes
1answer
34 views

Filter quotes by owner division SOQL

I am using JsForce to query my orgs salesforce data. I am trying to select all quotes that belong to salespeople from my division. I am very new to SOQL and SalesForce so the best I have come up with ...
0
votes
1answer
31 views

ORDER BY Event date when making an sql query inside MC

https://help.salesforce.com/articleView?id=mc_as_data_view_click.htm&type=0 Each view has some type of event-date creation. When creating my automation and appending the SQL query, I want use ...
0
votes
1answer
22 views

Join Subscriber Data to _Open and _Click Data view

How Can i join _Subscribers to this below query to get email address also? Select s.SubscriberKey, s.JobID, s.BatchID, convert(char(19),s.EventDate,20) as SendDate, c.[Click], o.[Open] FROM ( ...
1
vote
1answer
31 views

Check if date is between date range

I am trying to check if a persons birthdate is between the next 8 and 14 days. As an example: Today is the 10th of February - Check if the persons birthdate >= than 18/02 and <= 24/02. Today is ...
2
votes
0answers
22 views

Querying for Validation Rules and Workflow Rules by criteria

I'm trying to query for all Validation Rules and Workflow Rules that have a specific value in the criteria. From developer.salesforce, I see that I can query Validation Rule, but I need to filter ...
1
vote
1answer
45 views

What Does Cardinality Mean in the Query Plan Tool?

I am running below query in query editor in the free developer edition SELECT count() FROM contact WHERE createdby.Name = 'gs650x' I am getting 17 records but when I click query plan tool I get ...
3
votes
1answer
95 views

SQL Query timing out - Optimization Help?

I'm trying to run this as a query activity (writing to a data extension) but am finding that it's timing out. It's not all that 'heavy' of a query but it's not completing. I'm a database developer by ...
0
votes
0answers
30 views

Building an effective Suppression List in Marketing Cloud Enterprise 2.0

In our marketing cloud enterprise 2.0 instance, I'm trying to build suppression lists, one for each of our child BUs (brands). We're just standing up our 2.0 instance, so we don't yet have 6 months of ...
0
votes
0answers
44 views

want to query all ContentDocument without changing permission “Query All Files: Allows View All Data”

I want to run the following SOQL and want to get all the ContentDocument from all users. SELECT OwnerId, Title, FileType, LatestPublishedVersionId, ContentModifiedDate, CreatedDate FROM ...
0
votes
1answer
67 views

Querying for Perm Set

I would like to query to see if a user has a permission set. I want to return the response as Boolean value. Current Code: public static Boolean returnUserPermIds(){ List<...
-2
votes
1answer
39 views

How to avoid the 'Too many SOQL queries: 101' error in trigger helper?

I have a before insert and before update trigger with helpers and helper for these helpers. In both helpers I get the 'Too many SOQL queries: 101' error because of queries in loops. How do I get SOQLs ...
0
votes
2answers
36 views

Getting Wrong data in Salesforce Marekting Cloud Query

I have written the following query in my child BU to get data from subscribers. Select EmailAddress,Status,Subscriberkey,DateUnsubscribed from ent._Subscribers I am storing this records in Data ...
7
votes
2answers
57 views

How to query an Installed Package Id

I'm trying to properly build a relative URL from within a managed package context, so that a simple link can be provided to the user to bring them to the assign licenses page specifically for that ...
0
votes
2answers
45 views

Query to find date of subscriber's latest email

I'm trying to build a series of queries to keep a definitive list of all subscribers, along with the date of their latest email from us. I've almost got it working but not quite. The sequence is as ...
0
votes
2answers
40 views

How can I take my SOQL out of the loop?

I have an Id in the String format. I'm trying to convert this string into lookup field if it's the Gear__c Id. How can I take my SOQL out of the loop? trigger SMSTrigger on Message__c (before insert) ...
1
vote
1answer
24 views

Where does this Column come from (In Sql Query)?

I came across a Query that is very useful if I could figure out where a column name is being called from. (So I can edit and repurpose). The Query is: Select o.Owner.Username, o.OwnerId, o.Account....
0
votes
1answer
31 views

Performing an Group By Function in SQL in Marketing Cloud Activity [closed]

I'm trying to perform a Group By function on my Click data view Data Extension, which was built from the _Click data view. (Not sure if it's necessary to have the extra layer.) I am looking to ...
0
votes
2answers
42 views

How to get all records of object since specific date?

I'm using Python with simple-salesforce package. Eventually I'm running queries like: make_query("SELECT Id, Email, Name, Title FROM Contact") What I want to do is getting all records of the ...
0
votes
2answers
57 views

Primary Key combination for _Click data view

I am building replications of some system data views in order to be able to hold data that goes back further than 6 months (we are a seasonal business so want to look back at least 13 months). I ...
1
vote
1answer
51 views

SOQL Aggregate query

I am trying to query the most recent ActivityDate on an Account. Since aggregate function does not work on the Standard ActivityDate field on Tasks, I created a custom field ActivityDate__c to return ...
0
votes
0answers
15 views

Query - innerjoin customer data extension with file drop data

Goal: automate a tradeshow email based on file drop data. I've successfully ingested the file drop to a data extension. Now trying to find customers that qualify for the email send based Business Name ...
1
vote
1answer
36 views

SOSL query getting malformed query exception

I have built up a dynamic search query using sosl The query string given below FIND {a016g00000D57xKAAR} IN ALL FIELDS RETURNING Attachment(ParentId), ContentVersion(FirstPublishLocationId), ...
0
votes
1answer
50 views

Querying when a value changed in a DE

I'm attempting to query when a value changed in a particular data e.g. when the email address for subscriber 12345 was changed, if ever. Is there a way to query this information?
0
votes
1answer
33 views

Filling a map with a query

i'm having big troubles to fill a map with the data of fields of related objects to the one that is declared as value. Map<Id,GPMIR_obj_energyLead__c> mapToMap = new Map<Id,...
-1
votes
1answer
47 views

How to get more than 50K records in a trigger handler from SOQL [closed]

I have a requirement where I'm getting more than 50k records for a single parent id, and I need those whole records to process them. I now batch is the best option to use but that would be time ...
1
vote
0answers
15 views

AgentWork access to LiveChatTranscript

I am working with the AgentWork object. Which is an object that relates the Id of an agent with the field UserId and Its associated work with the field WorkItemId. In this case the works are chats, ...
0
votes
1answer
20 views

Querying synchronised data extention

I had a task of getting records from a synchronised data extention and get the opens and clicks from the emails of that DE. The problem is that I cant see those DE in query category . So, i was ...
1
vote
2answers
35 views

Select records from a List with a specific RecordTypeId

I have a List of the object Animal, with records from two different record types, How can I return another List with the animals with one of those record types?? Preferrably using a query instead ...
4
votes
1answer
76 views

More efficient to query or to loop through a bulk return of sObjects

Kind of a vague question but I am writing some "rollup" or summary queries that in totality will collect right around 340 account records between the 4 of them. These are rolling up from (client) ...
0
votes
2answers
66 views

Newest records for a SOQL Query

I have the Object Case and the Object Agent and I have multiple Agents created by Case. Both of them have their Ids. Agent has a field CaseId and I want a List with the newest Agents related with a ...
0
votes
0answers
71 views

FIELD_INTEGRITY_EXCEPTION, Every asset needs an account, a contact, or both and field comparison

I have been trying to insert new assets to the asset table and use the serial_number to check if the asset already exist before inserting it to avoid duplicates. I'm at the point where I am trying to ...
0
votes
1answer
47 views

Batch with 3 related objects

Suppose i have 3 related objects: Continent - Country - City. Country object is child object of Continent and City is child object of Country. City -> Country -> Continent. I would like make changes ...
1
vote
1answer
30 views

Working with searches and query API. Executing a SOQL query using “IN” clause

select Id, Name from Contact where Email in ('apple+super@gmail.com','apple+100@gmail.com') Can anyone help me to query this using the salesforce query api endpoint. The endpoint that I have tried ...
0
votes
1answer
54 views

Unable to select Filtered Data Extension as target in SQL query in Marketing Cloud

I have created 2 filtered data extension from a shared data extension using filter. I want to automate those filters so that the DE's will be auto refreshed. I realized that automating filter ...
1
vote
3answers
599 views

Is There a Way to Know if an Id Exists Without Querying?

Is there a way to know if an Object ID exists in a sandbox without querying for it? Sometimes we store ID's in Metadata/Custom Settings and I'm curious if there is a way to know if the ID exists ...
2
votes
1answer
88 views

Journey, tracking subscribers in WAIT state

I have a question about Journeys, can I track subscribers that are in a state of WAIT inside a journey? I tried to track with Data View: Journey Activity but the column JourneyActivityObjectID is ...

1
2 3 4 5
26