Decision Tables and Choice type variable

Raquel Pio
Tera Contributor

I had a requirement to send an email notification to a specific email address depending on a condition. My first thought was, I am going to do an if else in a Flow Designer. However, after talking with a colleague, she told me the best approach to would be with a decision table. Which, does not need the use of if else statement in Flow Designer, and whenever the business conditions changes, it can be updated direct in the Decision Table, without editing the Flow Designer.

 

RaquelPio_11-1755809944349.png

 

Another advantage is an excel can be exported and shared with the business for them to update it, and after it can be imported with the required changes.

 

RaquelPio_12-1755809974520.png

 

Since, I did not know anything about Decision Table, I started to read how to implement it. I am writing this because I don’t want you to suffer like I did, so, I am going to share with you what I discovered so far about Decision Table.

 

I created my Decision Table with the three inputs and the conditions that I needed. In my case there are three variables that are reference type, where two are from the Question Choice [question_choice] table and one is from Location [cmn_location] table.

 

RaquelPio_13-1755810024362.png

 

Decision Table created, now is time to use it the in the Flow Designer, with the Make a Decision flow logic. In the Decision table inputs you can use the Get Catalog Variables pills.

 

RaquelPio_14-1755810057611.png

 

However, if you have a Choice type variable you can not use it in the Make a Decision.

 

RaquelPio_15-1755810083443.png

 

It is not the end of the world since you can do a workaround 😅.

 

I created Flow Variables of reference type to store the variable values:

 

RaquelPio_16-1755810133042.png

 

And I used the Look Up Record action to find the question choice sys_id record.

 

RaquelPio_17-1755810148340.png

 

And I use the Set Flow Variables with the values of the look up action.

 

RaquelPio_18-1755810165851.png

 

And I used the Flow Variables in the Make a Decision flow logic.

 

RaquelPio_19-1755810183071.png

 

Now it is time to see the test results:

 

RaquelPio_20-1755810198712.png

RaquelPio_21-1755810211259.png

 

Please, share your thoughts on this and let me know if there is any way that I can improve my logic 😉.

1 REPLY 1

Bhimashankar H
Mega Sage

Hi @Raquel Pio ,

 

That's great use of decision table, we can edit the rules in excel and import the rules in decision table.  It's is maintainable and scalable as well.

 

Thank you for sharing.

 

Thanks,
Bhimashankar H

 

-------------------------------------------------------------------------------------------------
If my response points you in the right directions, please consider marking it as 'Helpful' & 'Correct'. Thanks!