Jump to content
  • Adding an if/then/else to a Lookup block


    Manoj Chaurasia

    Question:

    I am told that it is possible to add some conditional logic to a Lookup step inside Scribe Online.  It appears that you can drag an if/else block below the Lookup but it isnt clear how to write the formula.  Has anyone been able to get this to work? 

     

    Answer:

    A common pattern used in Scribe is this:(see attached Sample)

    Do a lookup and right after the lookup, add an IF /Else block to determine if  that particular record lookup, was successful or not.

    You can add as much lookups and If blocks as you need to determine the exact results and actions needed in your App Flow design logic.

    Result.RecordsMatched can have three results:

    match = 0 ; no match found, in that case the lookupfields are set to NULL, (no use to keep using these resultsets as it will most likely generate errors in the next lookup or update block.)Sometimes this is what you expect in order to do an alternate lookup (i.e. lookup account, if account not found, lookup contact.) 

    match =2 ; meaning multiple matches have been found, this is usually also not a good result, since you will need to use a Fetch block to loop thru all the different match results. (a lookup only shows one resultset, no matter how many matches you have.)

    match =1 ; usually this is what you expect from a lookup result and this asserts you that your data is ready for the next step in the integration.

    patternlookupandvalidateresultmaps_json.txt


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...