How to prevent creation of duplicate record through a flow designer without hard coding?

Shariq Azim
Kilo Guru

Hello,

I have stumbled into this issue while building  our logics around flow designer to create a record on a table A with some values , only if it is not  created yet , otherwise if found then update the same record with some values. Later, use the attributes from the same record for reference into other table's B fields. . I am not able to build this logic natively with flow designer steps. I am aware that I can do it all hardcoded gliderecords and etc., but it not be as elegant as OOB data pills. 

What i have tried so far?

1.Creating a logic of if with some conditions, and create record there and later call with inline script like

if(fd_data._6__look_up_record.status.toString() == '1'){
gs.info(fd_data._6__look_up_record.status.toString());
return "sys_id=066a2ec61b826c502cd4982d0d4bcba3";
// return "sys_id="+fd_data._8__create_record.record.sys_id.toString();
}
return "sys_id="+fd_data._6__look_up_record.record.sys_id.toString() ;

Now, the flow designer will break and not progress if we comment the first return line and then uncomment the return part in inline if condition.

 

2. Creating output variables and assigning values, just how we create temporary variables in normal scripting. But ,OOB flow doesn't allows displaying the outputs by calling from within the same flow.

 

Once again I would like to mention that,  creating the record with hardcoded values /scripts is not what I am looking for as we are planning to allow some non technical members from our team to update it later maybe(that is why we chose flow designer).

 

Hope I could explain the scenario to you.

Please let me know if you have any suggestions for me.

 

Regards,

Shariq

 

2 REPLIES 2

Maik Skoddow
Tera Patron
Tera Patron

Hi Shariq,

why do you say, it is not possible with Flow Designer to prevent duplicated records? There are a lot of examples with OOTB flows, for example

find_real_file.png

Kind regards
Maik

If my answer replied your question please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.

Hello Maik,

Thank you for your response, but does not fit into my requirements. Tl;dr ,1. I am trying to reduce redundancy and hard coded scripts, 2. OOB in line script will fail during executions if you refer something not part of the current branch  even though the  "if" condition is failing to run.

With your suggested steps (or with most examples), even if i know that i need to create a record , i can only access the values of record only if i am continuing in the same branch of the flow.  In case that was not created as it existed, then obviously it should not enter in the branch and continue unaffected.   

But now suppose, you are trying to update/refer that record at later point of your flow, will you create two redundant flow branch logics that only has the information of the "create record"  and another for "look up record" steps? Or will you instead follow a single record step and keep the logics common for both? Obviously in most cases you will follow the one which has lowest redundancies right?

As I mentioned earlier I have observed, even if you put a if condition in your inline script to fail intentionally, it will fail during execution as information of one flow branch is  simply not accessible if you try referring it in  another flow ..

Please refer to attached image. AND IGNORE step 9 . Here I am trying to get the record of step 8 in step 10.. information of step 10 is referred in step 11. 

find_real_file.png

 

 

Regards,

Shariq