Flow Designer - Approval - If Manager no Approval required, if Not a Manager then requires Approval.

Mark Lanning
Tera Guru

With In Workflow Editor, we use this If Script below, to check if the Requested For is a manager, if they are then no Approval is Required, If Not a manager will ask for the Requested for Manager to Approve.

 

How can I do the same in Flow Designer?

 

    answer = ifScript();
    function ifScript() {
        var openid = current.opened_by.toString();
        var manid = current.request.requested_for.toString();
        var gr = new GlideRecord('sys_user');
        var grOR = gr.addQuery('manager', openid);
        grOR.addOrCondition('manager', manid);
        gr.query();
        if (gr.hasNext()) {
            return 'yes';
        }
    }
 
 
1 ACCEPTED SOLUTION

Ivan Betev
Mega Sage
Mega Sage

@Mark Lanning ,

 

you are using "Look Up Record" instead of "Look Up RecordS", that is why you don't see the counter.

 

These days, I am trying to achieve modularity without coding first (e.g. by using subflows), however if I really need a fine tuned solution which cannot be made with available components, I do it with custom action(s) 🙂

 

Just make sure to stick to the best practice like naming, modularity, reusability, etc.

 

Regards, Ivan

View solution in original post

8 REPLIES 8

Ivan Betev
Mega Sage
Mega Sage

Hi @Mark Lanning ,

 

Do you do it the same way as I do?

IvanBetev_2-1709226464001.png

then

IvanBetev_3-1709226630916.png

Regards, Ivan

Mark Lanning
Tera Guru

Ivan,

Thanks again for your help.

I did not have the option of Count?

 

Was also thinking - if this is something we use most often, do you think a personal action be a good idea?

Ivan Betev
Mega Sage
Mega Sage

@Mark Lanning ,

 

you are using "Look Up Record" instead of "Look Up RecordS", that is why you don't see the counter.

 

These days, I am trying to achieve modularity without coding first (e.g. by using subflows), however if I really need a fine tuned solution which cannot be made with available components, I do it with custom action(s) 🙂

 

Just make sure to stick to the best practice like naming, modularity, reusability, etc.

 

Regards, Ivan

Sohail Khilji
Kilo Patron
Kilo Patron

Hi @Mark Lanning ,

 

Before triggering approv or before approval activity you can simply create a 'If condition' action and then accordingly trigger the approval.

 

If your condition matches it will trigger approval if not it will move to else condition. 

 

I hope this helps....


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect