+ Start a Discussion
MedhanieHabteMedhanieHabte 

Stuck on Step 7 Process Automation Superbadge

Hi all, I am so close to finishing this process automation badge but am stuck in one area in Step 7.

I've built out my process builder as follows

User-added image
User-added image
User-added image

And my date formula as follows
 

Case(MOD(Date__c-DATE(1900,1,7),7),0,"Sunday",1,"Monday",2,"Tuesday",3,"Wednesday",4,"Thursday",5, "Friday",6,"Saturday", "")
 



Challenge Not yet complete... here's what's wrong:  The Robot Setup Day of the Week formula does not seem to be working properly. The Day of the Week should not fall on Saturday or Sunday. 

It works nicely but doesn't seem to pass, what could be up.
 

Best Answer chosen by MedhanieHabte
Robb BlobRobb Blob

Okay, I managed to pass it, but doing a little trick. What is happening is the following:

  1. Trailhead creates 7 Robot_Setup__c records. All of them with Date__c of 24th January 2018 (Wednesday).
  2. It checks how much of them are on Monday.
  3. It fails because all of them are Wednesday, and it was expecting 3 of them to be on Monday.
My guess is that the Date__c was intended to be incremental, making one record for each weekday, and therefore expects having 3 Monday ones (the Monday + the 2 of the weekend). But it creates all records the same day, so it's not gonna work.

Unless you do a dirty trick. What I did was check the debug logs on the Developer Console to see what was the name of the last record created on the failed trailhead check (they get deleted after it). In my case last record name was 'ROBOT-SETUP0024'. After that, I added to the process another diamond checking if the record name was 'ROBOT-SETUP0025', 'ROBOT-SETUP00246, or 'ROBOT-SETUP0027'. In case they are, add 5 days to their Date__c (so it's Monday).

And voilà, it passed because it found its 3 expected Mondays. I'm attaching a screenchots of the developer console, and the dirty fix I used:

User-added image

User-added image

User-added image

All Answers

Robb BlobRobb Blob
Hi,

Same here, my flow is a bit different but works smoothly nonethless. In my case I check if it's sunday or saturday on the logic diamonds, and then simply run the actions of adding 1 or 2 days to the record Date__c field. I get the same exact error.

User-added image

User-added image
Robb BlobRobb Blob

Okay, I managed to pass it, but doing a little trick. What is happening is the following:

  1. Trailhead creates 7 Robot_Setup__c records. All of them with Date__c of 24th January 2018 (Wednesday).
  2. It checks how much of them are on Monday.
  3. It fails because all of them are Wednesday, and it was expecting 3 of them to be on Monday.
My guess is that the Date__c was intended to be incremental, making one record for each weekday, and therefore expects having 3 Monday ones (the Monday + the 2 of the weekend). But it creates all records the same day, so it's not gonna work.

Unless you do a dirty trick. What I did was check the debug logs on the Developer Console to see what was the name of the last record created on the failed trailhead check (they get deleted after it). In my case last record name was 'ROBOT-SETUP0024'. After that, I added to the process another diamond checking if the record name was 'ROBOT-SETUP0025', 'ROBOT-SETUP00246, or 'ROBOT-SETUP0027'. In case they are, add 5 days to their Date__c (so it's Monday).

And voilà, it passed because it found its 3 expected Mondays. I'm attaching a screenchots of the developer console, and the dirty fix I used:

User-added image

User-added image

User-added image
This was selected as the best answer
Robb BlobRobb Blob
Just wanted to add one last thing for those who have problems finding the name of the trailhead-created records.
They are on the log, just a bit before the middle of it. I'm attaching a screenshot of mine:

User-added image

 
MedhanieHabteMedhanieHabte
Still nothing, what's more I don't see anything happening in the background.
MedhanieHabteMedhanieHabte
Still didn't do it for. What's more I don't even a an action for when I hit submit in the debug log.
Robb BlobRobb Blob
Make sure you have the developer console open before clicking the Check Challenge button, then it should appear a new log in the Logs tab on the lower section, just like the image below. You'll notice some differences, in yours, status should be something like "Assertion failed, expecting 3".

User-added image

Also, I'm pretty sure I didn't add any configuration to my dev console, but just in case, check your 'Debug > Change Log Levels' has this:

User-added image

 
MedhanieHabteMedhanieHabte
I changed the field name to Day of the Week and it worked!
Michele Losch 4Michele Losch 4
@MedhanieHabte I'm receiving the same error 
Michele Losch 4Michele Losch 4
@MedhanieHabte I tried Robb's method but it's not working for me. What did you do?
Thanks
MedhanieHabteMedhanieHabte
I renamed the field Day_of_the_week__c
Maheshkumar Selvaraj 10Maheshkumar Selvaraj 10
At Last, here is the solution for Step7 of Process Automation Superbadge :
User-added image
Michele Losch 4Michele Losch 4
@Maheshkumar what was your entry criteria for Robot Setup Created?
Maheshkumar Selvaraj 10Maheshkumar Selvaraj 10
@Michele Losch: I just included ISNULL() formula field; coz I am checking the another criteria ( Saturday or Sunday in ) in the Action entry criteria.
Apoorv Shukla 8Apoorv Shukla 8
Hi All,
Just Cleared this Badge, its actually very simple.. The Create Robot Process builder is using the formula to create the Date__c field, the formula previously was 

[Opportunity].CloseDate + 180..

For the sake of Step 7 requirement, change the formula to below:

CASE(MOD([Opportunity].CloseDate + 180 - DATE(1900, 1, 7),7), 0, [Opportunity].CloseDate + 181, 6, [Opportunity].CloseDate + 182, [Opportunity].CloseDate + 180)

No Hacks required :-D
Michele Losch 4Michele Losch 4
Noting is working for me haha. Any changes I make leads to this error: hallenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Update failed. First exception on row 0 with id 006f4000001uW9tAAE; first error: CANNOT_EXECUTE_FLOW_TRIGGER, The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 301f4000000PJ9t. Flow error messages: An unhandled fault has occurred in this flow
An unhandled fault has occurred while processing the flow. Please contact your system administrator for more information. Contact your administrator for help.: []
Patrick McClellanPatrick McClellan
Just a comment about this customer request to make setup date 180 days after close date... the smart thing would be to explain to her that, because 180 isn't an even multiple of 7, this will result in an uneven workload where all of the saturday and sunday setups get pushed to Monday, and there won't be any Thursday or Friday setups because none of the deals have close dates on Saturday or Sunday. Instead, simply set the setup date as closeDate + 182 -- an even multiple of 7. This means that all deals closed on a Monday will be setup on a Monday, Tuesday close = Tuesday setup, etc.
Michele Losch 4Michele Losch 4
So the only thing I can think of is that my process for step 5 automate opportunities is blocking me from checking the robot setup process. Any inputs would be appreciated. 
Patrick McClellanPatrick McClellan
NOTE: I haven't been able to validate anything because of the system error, but I have the thing working to spec.

I have two separate processes: one that creates the Robot Setup, and a second one that Pushes Setup to Monday. The Robot Setup gets triggered when a record is created or edited.

Criteria [Opportunity].StageName Equals Picklist Closed Won.
The action is to create a record of type "Robot Setup", with fields for the Opportunity referencing [Opportunity].Id, and Setup Date > Formula: [Opportunity].CloseDate + 180.
 
User-added image

A second separate process pushes setup from Sat/Sun to Monday. "Push Setup to Monday" is triggered when a Robot Setup record is created or edited.

First Criteria: [Robot_Setup__c].Day_of_Week__c Equals String Saturday
First Action: "Push Setup + 2 Days". No criteria, just update the records. Setup Date > Formula: [Robot_Setup__c].Setup_Date__c + 2

Second Criteria: [Robot_Setup__c].Day_of_Week__c Equals String Sunday
Second Action: "Push Setup + 1 Day". No criteria, just update the records. Setup Date > Formula: [Robot_Setup__c].Setup_Date__c + 1

User-added image

Hope that helps. Please let me know if that validates for you.
Patrick McClellanPatrick McClellan
BTW, one of the instructions on the #4 Validation says "Create a record type named RB Robotics Process RT. " I didn't see anything in the video script or slides that explains what that is for. Does anyone understand why we need that?
Michele Losch 4Michele Losch 4
I finally got it to work. I deactivated everything and then made these two processes. 

User-added image
Robb BlobRobb Blob
@Patrick The record type is needed in order to attach a sales process to it (with just the required picklist values), as a standard page layout gets the standard sales process.

@All The 'hack' I had to use was to bypass a defect in the checking algorithm. It will work assuming that you did everything right, but still the challenge won't complete (even though Sun/Sat properly changed to Mon). The defect is probably corrected, or should be soon, though.
Jeff DouglasJeff Douglas
Hey everyone... wanted to give you a little insight into what step #7 is testing for. You can probably write some anon apex to test this yourself. 

We are creating 7 opportunities with close dates on each day of the week. This should create 7 robot setup records, one for each opportunity. We are then updating the stage of all of those opportunities to 'Prospecting'. We are then checking each of the 7 opportunities to see if 'Day_of_the_Week__c' contains a Satuday or Sunday. There should be 3 records with Monday and then one with Tuesday, Wednesday, Thursday and Friday. HTH

Jeff Douglas
Trailhead Developer Advocate
Patrick McClellanPatrick McClellan
@Jeff, I suspect you meant to say you're updating the stage to Closed Won, not Prospecting. Closed Won is when the Robot Setup record should be created, correct?
Jeff DouglasJeff Douglas
Nope.... we are creating them with the stage "Closed Won" but are then updating them to "Prospecting" for another reason.

Jeff Douglas
Trailhead Developer Advocate
Patrick McClellanPatrick McClellan
I'm not following that logic. Wouldn't the company want the Robot Setup record deleted if the stage is changed from Closed Won? But you say you're testing the setup records AFTER you updated to Prospecting.
Tony White (BNE)Tony White (BNE)
There is a few of us stuck on step 6 that could use some guidance.... https://developer.salesforce.com/forums/ForumsMain?id=9060G000000BgVX
Sampat_KhuranaSampat_Khurana
Try to create a process flow as given in the screenshots below. This will work.

User-added imageUser-added imageUser-added image
kamesh sangilikamesh sangili
@Robb blobb. I just changed the Setup date on the Robet setup process to Opty Close date instead of the forumla Today()+180
Laura McCraven at ACNLaura McCraven at ACN
I worked on this for hours. Not sure if this is how anyone else set it up, but I had the Robot Record being created from the same criteria that sends the email (which is Closed Won for Customer or Prospect Accounts).  But Salesforce's code creates an Account with no Type, so my process builder wasn't firing. I removed that criteria and it passed. I spent WAY too much time on that :(
Sam Derik 4Sam Derik 4
To complete this challenge you must first change  field type of field "Day of the Week" on robot object to formula text and
use below formula.
CASE( MOD( Date__c - DATE(1900,1,6),7) , 0, "Saturday",1,"Sunday",2,"Monday",3,"Tuesday",4,"Wednesday",5,"Thursday",6,"Friday","") 

Instead of creating a new process You can clone the Existing process which you have build.
In Closed won criteria's immediate action Change formula of date field from [Opportunity].CloseDate + 180 to

CASE(MOD([Opportunity].CloseDate + 180 - DATE(1900, 1, 7),7), 0, [Opportunity].CloseDate + 181, 6, [Opportunity].CloseDate + 182, [Opportunity].CloseDate + 180)

With Regards,
Sam
vaishnavi komminenivaishnavi kommineni
@Sam Derik 4 i tried to change the formula but its saying cant use the function Date__c
WR Scott StrongWR Scott Strong
Apoorv Shukla 8's comment above is the easiest way i've found! 

Just need to change the process builder that creates the Robot when the Opportunity is Closed/Won.
Pavlo ShchurPavlo Shchur
@vaishnavi komminen make sure that the format of the Date__c custom field is Data. Otherwise, provide some screenshots. 
Matt BrandtMatt Brandt
Apoorv Shukla 8 is 100% correct - it's the easiest way to do it. Just edit the process you created when the deal was changed to Closed Won and the Robot Setup record gets created. To pass that, you needed to set the date 180 days in the future. Just edit the formula to Apoorv Shukla 8's solution and it'll pass!
Adam Johnson 11Adam Johnson 11
You can pass this challenge simply by changing your formula field for "Day_Of_The_Week__c" to look like this CASE( MOD( Date__c - DATE(1900, 1, 7), 7), 0, "Monday", 1, "Monday", 2, "Tuesday", 3, 
"Wednesday", 4, "Thursday", 5, "Friday", 6, "Monday","Error")

No process builder or any automation needed to pass the challenge. 

I know that probably isn't the intended solution - as the goal is to prove you can use automation to say that if a set up date was intended to be on a Saturday, you would add 2 days to the date to have it be a Monday, but I was able to pass this step in less than a minute
Ravi ModiRavi Modi
Thanks this worked for me ;
For the sake of Step 7 requirement, changed the formula in the orginal flow where you create record robot based on oppty Won , no need of separate Proccess flow for Robot Date setup. 

CASE(MOD([Opportunity].CloseDate + 180 - DATE(1900, 1, 7),7), 0, [Opportunity].CloseDate + 181, 6, [Opportunity].CloseDate + 182, [Opportunity].CloseDate + 180)
Evelyn Tomer 9Evelyn Tomer 9
I had a terrible time with this - until I realized my older process was set to create a setup and fill in the date only when the opportunity stage is "Closed Won". This worked to pass the previous challenge - but because they are testing this with "Prospecting", I wasn't able to pass until I updated the criteria in the process... tricky!!
Emma Sayer 7Emma Sayer 7
Thank you everyone for your contributions to this. I did this so many times today I was starting to doubt myself, I had a process there, it worked fine but because they are testing it in a very specific way my method wasn't quite perfect! But thanks to you all I got there in the end!
YongKYongK
Had to check the developer console. Seems like their check can't find any Robot setup records in my scenario which tells me that my process is not generating any robot setup records. 

SOQL_EXECUTE_BEGIN [23]|Aggregations:0|SELECT COUNT() FROM Robot_Setup__c WHERE Opportunity__c IN :tmpVar1
SOQL_EXECUTE_END [23]|Rows:0

I had to remove the prospect and customer filter criterias in my process builder's close won diamond and it worked. Hope that helps.
Joel Murav 9Joel Murav 9
So i am TOTALLY Stuck and after 10+ hours i want to give up, but refuse to as i am LITTERLY ON THE LAST STEP.

Can someone please help!

Here is where i am at:

I created a formula field for day of the week:

CASE( MOD( Date__c - DATE(1900, 1, 7), 7), 0, "Sunday", 1, "Monday", 2, "Tuesday", 3, 
"Wednesday", 4, "Thursday", 5, "Friday", 6, "Saturday","Error")

And it works. I confirmed Saturday and Sunday Populate

I then created 2 processes:

1) The process that was created in earlier steps of the challenge; and in the last step i have the following for Opportunity Closed:
 - When Closed, Create a Robot Record, and set the following 
[Opportunity].CloseDate +180, And i confirmed this works from prior challenges.

Then i have a second process, that changes the Date, if the Day of the week is saturday or sunday (and i confirmed that this process works, when i run it in salesforce, BUT my challenge still fails!

If Day of the week is Saturday , change [Robot_Setup__c].Date__c +2

If Day of the week is Saturday , change [Robot_Setup__c].Date__c +1


I did try to MODIFY the first process with the following formula for the Date Field (before creating the second process) and it still failed!

CASE(MOD([Opportunity].CloseDate + 180 - DATE(1900, 1, 7),7), 0, [Opportunity].CloseDate + 181, 6, [Opportunity].CloseDate + 182, [Opportunity].CloseDate + 180)


Can someone please help!

 
Joel Murav 9Joel Murav 9
So i went a step further and Just had the Opportunity process CREATE the Robot Record and NOT populate a Date value at all.

Then in the Robot Create Process (my second process) , I had the first step POPULATE the Date Field, and i used the following Formula


CASE(MOD([Robot_Setup__c].Opportunity__c.CloseDate  + 180 - DATE(1900, 1, 7),7), 0, [Robot_Setup__c].Opportunity__c.CloseDate  + 181, 6, [Robot_Setup__c].Opportunity__c.CloseDate  + 182, [Robot_Setup__c].Opportunity__c.CloseDate  + 180)

Then Have my steps to Change the date if the day of the weeks falls on a Sunday/Monday

And it STILL WONT WORK.

I can make the date change MANUALLY and when i select saturday or sunday, the process does work and change the date to monday

Please help
Smita HodiggeriSmita Hodiggeri
@Ravi modi.. Thanks Ravi that formula worked me as well