Question

Code step hit an error - I do not understand why - please help :)

  • 16 November 2022
  • 1 reply
  • 42 views

Hi, 
 

The following code (validated when tested) is hitting an error when the related zap is in operation. I can not understand why. Any clue?

 

code:

country = input_data['country']robin_value_AMER = input_data['round_robin_value_AMER']round_robin_value_AMER = str(robin_value_AMER)robin_value_EMEA = input_data['round_robin_value_EMEA']round_robin_value_EMEA = str(robin_value_EMEA)robin_value_APAC = input_data['round_robin_value_APAC']round_robin_value_APAC = str(robin_value_APAC)robin_value = input_data['round_robin_value']round_robin_value = str(robin_value)list_countries_AMER = ['United States','Chili']list_countries_EMEA = ['France','Germany']list_countries_APAC= ['China','Japan']round_robin_owner = ''sfdc_search_found = input_data['sfdc_search_found']str_sfdc_search_found = str(sfdc_search_found)if str_sfdc_search_found == 'True':    sfdc_owner = str(input_data['sfdc_owner'])   # If lead was found on SFDC, then assign the SFDC owner as the round robin owner for the rest of this zapif str_sfdc_search_found == 'True':    # Taylor    if sfdc_owner == '0055f000006jaUVAAY':        round_robin_owner = '0'    # Rob    elif sfdc_owner == '0055f000006jaUWAAY':        round_robin_owner = '1'     # Adrien    elif sfdc_owner == '0055f00000AgpRBAAZ':        round_robin_owner = '2'     # Andrew    elif sfdc_owner == '0055f00000BedqfAAB':        round_robin_owner = '3'     # Philip    elif sfdc_owner == '0055f00000B5G8jAAF':        round_robin_owner = '4'      # If SFDC owner value is empty, then assign the default round robin process    elif sfdc_owner == '':        round_robin_owner = round_robin_value# If SFDC owner value is empty, then assign the geographical round robin processelse:    # AMER - Successively, round_robin_value_EMEA will take as value '0' for Taylor, '1'  for Rob, '3' for Andrew       if country in list_countries_AMER:            round_robin_owner = round_robin_value_AMER    # EMEA - round_robin_value_EMEA will only take as value ‘2’ since Adrien is     currently the only AMEA Sales.       elif country in list_countries_EMEA:        round_robin_owner = round_robin_value_EMEA    # APAC - round_robin_value_APAC will only take as value ‘4’ since Philip is currently the only APAC Sales.    elif country in list_countries_APAC:        round_robin_owner = round_robin_value_APAC  # If country value is empty, then assign the default round robin process    else:         round_robin_owner = round_robin_valueoutput = [{'round_robin_owner': round_robin_owner}]

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

Userlevel 7
Badge +14

Hi @violettelep 

Good question.

Check your Zap Runs to see the DATA IN/OUT for each Zap step to help you troubleshoot: https://zapier.com/app/history/

You may need to use another Code editor to help you isolate the error.