function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ChopkinsChopkins 

Desktop Flow Designer - Data source not returning data

Hi all,

I'm new to the Desktop Flow Designer and am trying to use a data source element with an advanced script to pull all contacts for a specific account.  I have created a choice lookup then then uses the data source to populate the choices.

Everything works fine if I use the "I will select the table with the data" option for the data source.  Contacts all day long in the choice lookup.

 

However, if I switch over to "I will write an advanced script" I get no results at all in the choice lookup.

Here's what the datasource query looks like:


SELECT AccountID, Id, LastName, Name, Contact_Type__c
FROM Contact
WHERE (AccountID= 'XXXXX')
ORDER BY Name

 

I replace the XXXX with the value of the AccountID which I've verified as correct - just can't get any data.

 

And it is killing me, people.  I need data.  I must have it to survive.

 

Can anyone help?

 

Chopkins

markross__cmarkross__c

Reminds me of that line in Sherlock Holmes... "Data, data, data, I cannot make bricks without clay!"

 

A couple things to try:

Have you tried both the 15-character and the 18-character form of the Account ID? I've found that sometimes the Desktop Flow Designer wants one in some places, and the other in other places.

 

Also, from your description, it sounds like you could do this without an advanced script. You should be able to define a Constant, putting your Account ID there, and in your Choice Lookup add a filter that restricts the data so that AccountID equals YourConstantName.

ChopkinsChopkins

Man, the 5 minutes that it took me to get the 18-character AccountID were exciting!  Turns out, based on a DataLoader extract, you're right - the AccountID being stored in Contact is 18 characters.

 

I typed furiously, I saved righteously, and ran full of confidence.

 

And then still no data.

 

Here's the deal - I started out trying using the constant for the AccountID but the problem is that I really need to pull contacts into this choice lookup based on 2 criteria:

 

1) The AccountID matching the AccountID that I will magically pass to it from a custom button that I will build when I'm 80 and this has been resolved.

2) The presence of the "Support" value in the Contact_Type__C field - this is a multipicklist field that can have values of:

 

- Sales

- Support

- Sales;Support

 

So I started using an advanced script to accomodate the multipicklist value match (which I believe requires the use of "INCLUDES").

 

And now the datasource script won't work even though I confirmed that the 18-character AccountID is being used by the contact record (and which, incidentally) works when I use it in a constant as you suggested.

 

Unfortunately, since my goal is only to allow Contact_Type__C values containing "Support", I think I still need to use the data source and so am back to square one.

 

Plus, when I add the Contact_Type__c includes statement, it looks like the advanced script window is removing the semicolon.

 

This:

 

Select AccountID, Id, LastName, Name, Contact_Type__c
From Contact
Where AccountID='XXXX' and Contact_Type__c includes ('Sales;Support','Support')
ORDER BY LastName

 

Becomes this:

 

Select AccountID, Id, LastName, Name, Contact_Type__c
From Contact
Where AccountID='001000000064KttAAE' and Contact_Type__c includes ('SalesSupport','Support')
ORDER BY LastName

 

Notice the semicolon gone?

 

This was one of the reasons that we purchased Enterprise edition and I've been working for 3 days just trying to get a list of eligible contacts to show up on the screen.

 

I could have done a lot in those 3 days.  I could have been a contender.

 

Chopkins

 

 

ChopkinsChopkins

Update: I got the query to work using this syntax:

 

SELECT Id, LastName,Name from Contact 
WHERE (AccountID='14-digit AccountID' AND CONTACT_TYPE__C INCLUDES ('Support'))
ORDER BY LastName

 

It appears that if you include the AccountID and/or the CONTACT_TYPE__C in the SELECT statement no results are returned. 

 

I was under the impression that to use a field in a WHERE statement you had to first SELECT it but that's apparently wrong.

Varun99Varun99

Hi,

     I have small doubt plese help me

I am new to salesforce i want to design

a flow using flow designer or cloud based flow

to display all contacts in my contact object

please help me how to design?

 

 

Thank you.

Varun99Varun99

Sorry

 

Hi,

     I have small doubt plese help me

I am new to salesforce i want to design

a flow using flow designer or cloud based flow

to display all contacts from my contact object

in flow designer please help me how to design?

RajaramRajaram

All contacts may not be the right thing to do as there may be too many of them. Also the flow engine will restrict the rows fetched to 200.

What  you can do is to configure flow to fetch the contacts using sime criteria and display them as drop down or radio buttons. To do this,

1. Create a Flow

2. Create a Screen Element 

3. Create a SCreen Choice field

4. Create a Dynamic Choice configured to go against the Contact object.

 

Hope this helps.