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
-1
votes
1answer
23 views

Is it possible to merge Data from List and Data Extension via query in Marketing Cloud?

Is it possible to merge Data from List and Data Extension via query in Marketing Cloud? I need to create a Data Extension with SubscriberKey from the list and FirstName from the Data Extension. Which ...
1
vote
0answers
35 views

SOQL query with 'LIKE not giving expected results

In my org, I've set up some custom metadata on which I have all text fields which I am querying. On my query without anything in the where condition SELECT Label,Fields__c,Labels__c,Scheme__c from ...
-2
votes
1answer
27 views

Generate a table embedded in an email from a SOQL query [closed]

I would need to generate a table out of a SOQL query and embed this in an email using Apex. I know that there is a good method for that setHtmlBody(HTMLBody), but, as I am new at programming, I do ...
1
vote
1answer
20 views

Unable to Perform SOQL Query Involving Lookup Field

I have a custom object (Registration__c) that has a lookup field (Approver__c) to the standard User object. I'm trying to construct an SOQL query that will return the user's ID. My assumption is ...
3
votes
1answer
25 views

Can There be Multiple Result IDs for a Query Operation Result?

When retrieving the result of a batch of a query bulk job, according to the documentation, the following is returned. <result-list xmlns="http://www.force.com/2009/06/asyncapi/dataload"> <...
5
votes
1answer
140 views

SOQL bug for null required-lookup fields?

It appears that querying null values for required lookup fields always returns 0 results, even if some records have no value in the required field (e.g. records created before the field was made ...
0
votes
0answers
31 views

Error in query with Synch DE

I have synchronized two De from sales Cloud successfully and I'm now trying to run a query using them. I get an error message which tells they are unknown. I wonder which can be the error causing ...
0
votes
1answer
56 views

Contact fields not accessible in SOQL Query on User

I am working with Community users and I need to query both their User and Contact details at the same time. When I am performing a relationship query like [Select Id, Email, ContactId, Contact....
0
votes
1answer
30 views

Automation studio - Error in Query script

I'm running a query with the following structure SELECT * FROM [nameDE] WHERE PersonhasOptoutOfEmail = No I got an error message on the WHERE condition and I don't understand which is the issue. ...
0
votes
2answers
25 views

Duplicate data from a synchronized data extension- Can't see the Syn DE in Automation studio

i'm working in Automation Studio in order to duplicate the data of synchronized DE into a new sendable DE. The problem I have is that I see the synchronized DE in Contact Builder but I can't find it ...
1
vote
0answers
18 views

INVALID_TYPE ERROR while querying using REST API

I'm trying to run a query using REST API (RestSharp). This is my query: [SELECT Id FROM Account] This is my code: RestClient m_Client = new RestClient("https://my_instance.salesforce.com"); string ...
0
votes
1answer
20 views

When I am querying from User object facing error Illegal assignment from List<User> to List<User>

When I am doing two SOQL queries in an apex method on User Object, facing an error like- User u = [SELECT Id, IsActive FROM User WHERE username = 'some username']; List<User> userList = [...
0
votes
1answer
31 views

Salesforce Marketing Cloud Query - Count by Date and Appointment Status, Group By CustomerID

I'm not proficient in SQL Query. I'm hoping someone on here can help me write this query for Saleforce Marketing Cloud, which uses a "limited" SQL Server 2016. Problem: I'm trying to extract month ...
0
votes
0answers
35 views

Smarter ways to write APEX class which consists of multiple methods executing a DML statement

I have a scheduled job that executes several methods from one apex class, code as follow; public class dailyUpdates{ Date Dday = system.today(); public void scheduledUpdates(){ ...
0
votes
1answer
19 views

add hours to timestamp / sql activity

I want to add 7 hours to a timestamp value and write the value into another data extension. How can I add these hours? My poor first try: SELECT DATEADD(HOUR,+7,dateregister) AS ...
0
votes
1answer
29 views

Why does my custom metadata field defintion query not work?

I'm reading the answer to this following question: How to get a field's API name when querying a field of datatype, Metadata Relationship(Field Definition) However, when I run the following ...
0
votes
0answers
22 views

Errors for count() via Dev Console (No response from the server) and Workbench (future_get-9-1588268637)

Need to test out different grouping strategies for a matching process I'm building. Problem is there are too many records to query the data for a count(). In dev console I get a 'communication failure:...
0
votes
0answers
28 views

MC Connect with BU : Query synchronized data extensions / Salesforce data on Data designer

This is linked to the question : Filtered Data extensions or Data extensions fed with SQL queries to duplicate Synchronized DEs from CRM to share with child BUs? It seems that we can query the ...
0
votes
1answer
19 views

How to create a new Data Extension using Queries?

My goal is to use a master data extension which has all contacts regardless of the possibility of sending emails. So I would like to use Queries to filter this Data Extension and create a new one with ...
3
votes
0answers
87 views

Why is my Salesforce-SOQL-Subquery-Query discarding entrie

UPDATE It seems that this issue only occures if the for-each-loop handles more than one entry. If the SELECT-Statement just handles one Near_By_Metadata__mdt, everything works fine and i get all ...
0
votes
1answer
29 views

Can we extract data of contacts that entered a journey and are not a part of email activity in Journey builder [duplicate]

-I am trying to extract data of contacts who entered the journey and who exit the journey as a reminder group and passed through wait by duration activity before flowing out of journey. -These ...
0
votes
1answer
48 views

Update a checkbox with a trigger

I don't know if I'm doing it right. I have to set checkboxes values to true after import new contracts, but just for the contracts that are related to an account that already has a Contract where the ...
0
votes
2answers
41 views

SOQL query for Multiselect picklist

Hello I'm trying to use string in SOQL query where clause for multiselect picklist. I need to get records of CustObj__c where Multipicklist__c fild have 'abc' or 'xyz' values. String str = '\'abc\',\...
0
votes
1answer
25 views

SFMC: How to add a prefix to values in a column

We are working on a use case where we needto add a prefix to our ID column. E.g. we have the real ID - e.g. 123xyz - and it shall have a prefix STAGE>> STAGE_123xyz is the final ID. Every record in ...
0
votes
1answer
23 views

How to GROUP BY + Merge values of a column together within a SFMC data extention

here is the problem I am facing. I essentially need to group and then take the values of any unique user, and combine them and delimit them out by " | " into the result for each product. Any idea how ...
0
votes
1answer
35 views

Marketing Cloud Data View Question - Query returns 0 records

Query select s.Emailaddress as 'Email_Address' , s.SubscriberID , s.subscriberkey FROM _Subscribers s JOIN _Sent se ON s.Subscriberkey = se.Subscriberkey is anything wrong with it? or is this a ...
0
votes
1answer
50 views

SQL Query for getting distinct domain and count

I have a Data Extension which has email address. I want to store all distinct domains and counts of these emails in another DE For eg: I have someth@som.com, test@test.com, 123@test.com. So my o/p ...
0
votes
2answers
63 views

How to List all Custom Objects from Salesforce API?

I'm currently working to use the Salesforce REST API to get a list of all Salesforce Custom SObjects without including System or Standard Objects (like how the /services/data/vXX.X/sobjects/ does). ...
2
votes
1answer
42 views

Why is my click data view query not delivering the results I expect?

I'm working on a setup of individual journeys triggered by clicks on certain furniture aliases. At the moment I have journeys starting when either of these aliases; 'WeLove_AlbaSidetable', '...
0
votes
0answers
35 views

Marketing Cloud data views for Journeys that do not send emails

Background My customer would like to create non-sending journey to get a better sense of the data coming into a journey, and decision logic we plan to use. We are experiencing lots of bad/dirty data, ...
0
votes
1answer
23 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
44 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
38 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
20 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,...
1
vote
1answer
41 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
27 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
41 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
58 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
26 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
34 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
20 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
47 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
82 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
24 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
40 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
41 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
24 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
32 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
35 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
107 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 ...

1
2 3 4 5
27