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
Tal BadehiTal Badehi 

Button launches flow with input data-type that comes up as error

Hello,

I created a flow and a button to launch it.
The flow was debuged and works perfectly. But when I try to launch it using a custom button I receive an error:

"We can't launch this flow because of a variable error. Send this error message to your admin. The value 19/12/2019 is being provided for variable TermEndDate but isn't compatible with the variable's data type (Date)...
As you can see the value is Date type. I doubled checked that the field referenced is indeed Date type.

Can anyone please direct me to how to solve this?

Thanks,
Tal
Best Answer chosen by Tal Badehi
Syed Insha Jawaid 2Syed Insha Jawaid 2
Hi Tal

Lets debug it this way:

1. Lets test it with simply launching the flow through URL parameters.(Hardcoded)
/flow/Quick_Renewal?Subscription=XXXXXXX&.....&TermEndDate=2019/12/12
2. Check the datatype of TermEndDate it is an input variable of type date.
3. If the hardcoded URL works then compare the URL launched while after clicking the button.

Lets do this and then lemme know!
Cheers!!!

All Answers

Syed Insha Jawaid 2Syed Insha Jawaid 2
HI Tal

How are you passing the Date Value ? Please attach screenshots for better understanding.

Cheers!!!
RD@SFRD@SF
Hi Tal,

If you were able to debug it and worked perfectly. Then may be the date is being taken as (mm/dd/yyyy), I have seen something similar before. Please can you try changing the date being passed to say (01/01/2018), if this works then you can confirm that if date is the issue.

Thanks
RD
Tal BadehiTal Badehi
Thank you both,

Here is the button url to pass values into the flow:
/flow/Quick_Renewal?Subscription={!OrderApi__Subscription__c.Id}&Status={!OrderApi__Subscription__c.OrderApi__Status__c}&TermEndDate={!OrderApi__Subscription__c.OrderApi__Current_Term_End_Date__c}.

I created a formula field with Date data-type, to switch between Month and Day values, then redirected the button link to grab that value instead of the original field. If the issue is with date format this should sort it out. Unfortunately it gives the same error.

Thanks,
Tal

 
Syed Insha Jawaid 2Syed Insha Jawaid 2
Hi Tal

Lets debug it this way:

1. Lets test it with simply launching the flow through URL parameters.(Hardcoded)
/flow/Quick_Renewal?Subscription=XXXXXXX&.....&TermEndDate=2019/12/12
2. Check the datatype of TermEndDate it is an input variable of type date.
3. If the hardcoded URL works then compare the URL launched while after clicking the button.

Lets do this and then lemme know!
Cheers!!!
This was selected as the best answer
Tal BadehiTal Badehi
Hi Syed Insha Jawaid,

Thanks for the suggesting this approach for debug, which I wouldn't have thought.
I took on a different route to go around the problem and used Record Lookup instead of the input veriable.

Many thanks all for your help (and happy new year),
Tal