Help With Logic if Error

I could really use some logic with a registration forum that I am trying to automate where I take the data from my CRM software and input it into another website. The issue I am facing is with the logic if someone fails to enter a field:

The script starts off searching how a client decided to fine-tune their search through one of the following static options: “by General Area” or “by Address” as seen in the code below:

,
    {
      "Command": "storeText",
      "Target": "xpath=//*[@id=\"app-container\"]/div/div/div[2]/div/div/div/div/div/div[3]/div[3]/div/div/div/div/form[15]/div/div",
      "Value": "Fine_Tune_Search",
      "Description": ""
    },
    {
      "Command": "if_v2",
      "Target": "${Fine_Tune_Search}.includes(\"Address\") == true",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "storeText",
      "Target": "xpath=//*[@id=\"app-container\"]/div/div/div[2]/div/div/div/div/div/div[3]/div[3]/div/div/div/div/form[16]/div/div",
      "Value": "ADDRESS_Ideal_Location",
      "Description": ""
    },
    {
      "Command": "storeText",
      "Target": "xpath=//*[@id=\"app-container\"]/div/div/div[2]/div/div/div/div/div/div[3]/div[3]/div/div/div/div/form[17]/div/div",
      "Value": "CITY_Ideal_Location",
      "Description": ""
    },
    {
      "Command": "storeText",
      "Target": "xpath=//*[@id=\"app-container\"]/div/div/div[2]/div/div/div/div/div/div[3]/div[3]/div/div/div/div/form[19]/div/div",
      "Value": "ZIP_CODE_Ideal_Location",
      "Description": ""
    },
    {
      "Command": "storeText",
      "Target": "xpath=//*[@id=\"app-container\"]/div/div/div[2]/div/div/div/div/div/div[3]/div[3]/div/div/div/div/form[20]/div/div",
      "Value": "Radius_In_Miles",
      "Description": ""
    },
    {
      "Command": "else",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "0",
      "Value": "Radius_In_Miles",
      "Description": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": "",
      "Description": ""
    },

Now that you have reviewed the code my question is how could I add multiple error handlers within an if_v2 statement without slowing down the code and adding a bunch of if_v2 statements. For example, I would add the following error handlers to this code:

store | 2 | !Timeout_wait
${ADDRESS_Ideal_Location}
?? I need code here to have it continue to the prompt to enter in the following data ??
Prompt | Missing Text Description Here | ${Missing_Field_Here}

Then I would repeat the above error handlers for the following statements:

${CITY_Ideal_Location}
${STATE_Ideal_Location}
${ZIP_CODE_Ideal_Location}

So you want to show the prompt if the scraped ADDRESS_Ideal_Location is empty?

@Plankton

The following code partially solved the solution! However, it now seems that ${!statusOK} == false, does not reset. For example, If I run this macro and the following fields:

  1. Address_Ideal_Location
  2. CITY_Ideal_Location
  3. ZIP_CODE_Ideal_Location

All have values associated with them everything works perfectly, however, if one of the values lets say CITY does not have a value associated with it the macro will do what it is supposed to do and Prompt for me to enter the CITY name, however, it will now prompt for Zip Code to enter its value! Worst case scenario if someone forgets to enter in an address which is the first request all fields following the address such as City and Zip Code will now prompt to enter in information! How can I get ${!statusOK} == false to reset and run properly as it should?


      "Command": "if_v2",
      "Target": "${Fine_Tune_Search}.includes(\"Address\") == true",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "2",
      "Value": "!Timeout_wait",
      "Description": ""
    },
    {
      "Command": "storeText",
      "Target": "xpath=//*[@id=\"app-container\"]/div/div/div[2]/div/div/div/div/div/div[3]/div[3]/div/div/div/div/form[16]/div/div",
      "Value": "ADDRESS_Ideal_Location",
      "Description": ""
    },
    {
      "Command": "gotoIf_v2",
      "Target": "${!statusOK} == false",
      "Value": "AddressUpdate",
      "Description": ""
    },
    {
      "Command": "gotoLabel",
      "Target": "NEXT #1",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "label",
      "Target": "AddressUpdate",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "prompt",
      "Target": "Provide ONLY The Street Address!",
      "Value": "ADDRESS_Ideal_Location",
      "Description": ""
    },
    {
      "Command": "label",
      "Target": "NEXT #1",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "storeText",
      "Target": "xpath=//*[@id=\"app-container\"]/div/div/div[2]/div/div/div/div/div/div[3]/div[3]/div/div/div/div/form[17]/div/div",
      "Value": "CITY_Ideal_Location",
      "Description": ""
    },
    {
      "Command": "gotoIf_v2",
      "Target": "${!statusOK} == false",
      "Value": "CityUpdate",
      "Description": ""
    },
    {
      "Command": "gotoLabel",
      "Target": "NEXT #2",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "label",
      "Target": "CityUpdate",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "prompt",
      "Target": "Provide City Name",
      "Value": "CITY_Ideal_Location",
      "Description": ""
    },
    {
      "Command": "label",
      "Target": "NEXT #2",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "storeText",
      "Target": "xpath=//*[@id=\"app-container\"]/div/div/div[2]/div/div/div/div/div/div[3]/div[3]/div/div/div/div/form[19]/div/div",
      "Value": "ZIP_CODE_Ideal_Location",
      "Description": ""
    },
    {
      "Command": "gotoIf_v2",
      "Target": "${!statusOK} == false",
      "Value": "ZipUpdate",
      "Description": "${ZIP_CODE_Ideal_Location} == (\"#LNF\")"
    },
    {
      "Command": "gotoLabel",
      "Target": "NEXT #3",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "label",
      "Target": "ZipUpdate",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "prompt",
      "Target": "Provide Zip Code",
      "Value": "ZIP_CODE_Ideal_Location",
      "Description": ""
    },
    {
      "Command": "label",
      "Target": "NEXT #3",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "storeText",
      "Target": "xpath=//*[@id=\"app-container\"]/div/div/div[2]/div/div/div/div/div/div[3]/div[3]/div/div/div/div/form[20]/div/div",
      "Value": "Radius_In_Miles",
      "Description": ""
    },
    {
      "Command": "else",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "0",
      "Value": "Radius_In_Miles",
      "Description": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": "",
      "Description": ""
    },

@Plankton

It looks like I resolved my solution by replacing ${!statusOK} with ${!lastCommandOK} == false . Can you please explain to me two things if you have time:

  1. Why did this fix my issue as I saw something regarding a [ ${BooleanVariable} == true on the forum.

  2. By me adding in a goto label Command after the gotoif_v2 command is the best way to add multiple if_v2 statements within the same statement as it was extremely hard to program this way and could be prone to breaking if someone changes the order by accident?

@Plankton no i figured it out below in the message!