• 0 Vote(s) - 0 Average
  • 5
  • 4
  • 3
  • 2
  • 1
Thread Modes

Conditional Step in Workflow on a "Yes/No" question
#1
Hello,
in an employee hiring request workflow, I need to insert a conditional step that manages the answer to the question "User needs a laptop". The question requires a "Yes/No" : according to the answer, the workflow will proceed with or without the step for configuring a laptop (see attachment)

can you help me writing the SQL /compiling the conditional step?

thanks a lot for your help!
G.

Thumbnail(s)
   
effeggi, proud to be a member of EV CONNECT FORUM since Oct 2016.

#2
(07-17-2020, 08:14 AM)effeggi Wrote: Hello,
in an employee hiring request workflow, I need to insert a conditional step that manages the answer to the question "User needs a laptop". The question requires a "Yes/No" : according to the answer, the workflow will proceed with or without the step for configuring a laptop (see attachment)

can you help me writing the SQL /compiling the conditional step?

thanks a lot for your help!
G.

Hello,
You can use this kind of script : 

Code:
select request_id from sd_question_result where request_id=@@ID@@ and question_id=(select question_id from sd_question where question_code='Q_Laptop_Needed') and RESULT_STRING_EN='Yes'

P.ABBE
ABBE Philippe, proud to be a member of EV CONNECT FORUM since Nov 2015.

#3
maybe this -->

SELECT a.RESULT FROM SD_QUESTION_RESULT as a
INNER JOIN SD_QUESTION as b ON a.QUESTION_ID=b.QUESTION_ID
WHERE a.REQUEST_ID in (@@ID@@) AND b.QUESTION_CODE='Q_Laptop_Required' AND a.RESULT='1'
pankaj.ahlawat@gmail.com, proud to be a member of EV CONNECT FORUM since Aug 2019.

#4
(08-03-2020, 03:50 AM)pankaj.ahlawat@gmail.com Wrote: maybe this -->

SELECT a.RESULT FROM SD_QUESTION_RESULT as a
INNER JOIN SD_QUESTION as b ON a.QUESTION_ID=b.QUESTION_ID
WHERE a.REQUEST_ID in (@@ID@@) AND b.QUESTION_CODE='Q_Laptop_Required' AND a.RESULT='1'

Yes,
Same result, my sql code can be improve but i prefered to describe relationship beetween table and use result_string_$lng to make the code easy to read. For this forum i stay teaching ("didactique" in french).
P.ABBE
ABBE Philippe, proud to be a member of EV CONNECT FORUM since Nov 2015.






Users browsing this thread: 1 Guest(s)