How to compare two array

Hi all

I am getting data from excel sheet and i need to validate that data that is present in the existing table or not 

If the particular data is not present or if there is any spelling mistake we have to throw an error of that particular word 

For example:

Reference table data: {india, usa, Australia,uk}

Excel data:{india, usa, Australi}

Here Australia spelling is wrong we have to display that the perticular Australi is not present

How can i do this any idea guys 

  Discussion posts and replies are publicly visible

Parents
  • a!localVariables(
      local!checkExcelItemsInRefTable: a!forEach(
        items: ri!excelArray,
        expression: contains(
          {
            ri!refTablearray
          },
          fv!item
        )
      ),
      /*Match each index of array to return a boolean array if match was found or not*/
      local!notFoundIndexes: wherecontains(
        false,
        local!checkExcelItemsInRefTable
      ),
      /*Indexes from excel array where the match wasn't found*/
      concat(
        joinarray(
          index(
            ri!excelArray,
            {
              local!notFoundIndexes
            },
            {}
          ),
          ", "
        ),
        " not found in reference table"
      )/*Returning the message with the values not found in reference table*/
      
    )

    Use a code like this to compare arrays and get the following result.

    Hope it helps!

    Regards,

    Kunal

Reply
  • a!localVariables(
      local!checkExcelItemsInRefTable: a!forEach(
        items: ri!excelArray,
        expression: contains(
          {
            ri!refTablearray
          },
          fv!item
        )
      ),
      /*Match each index of array to return a boolean array if match was found or not*/
      local!notFoundIndexes: wherecontains(
        false,
        local!checkExcelItemsInRefTable
      ),
      /*Indexes from excel array where the match wasn't found*/
      concat(
        joinarray(
          index(
            ri!excelArray,
            {
              local!notFoundIndexes
            },
            {}
          ),
          ", "
        ),
        " not found in reference table"
      )/*Returning the message with the values not found in reference table*/
      
    )

    Use a code like this to compare arrays and get the following result.

    Hope it helps!

    Regards,

    Kunal

Children
No Data