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!referenceTableData: {
        "india",
        "usa",
        "Australia",
        "uk"
      },
      local!excelData: {
        "india",
        "usa",
        "Australi",
        "Iran"
      },
      local!notPresentList: a!forEach(
        items: local!excelData,
        expression: if(
          contains(
            local!referenceTableData,
            fv!item
          ),
          {},
          fv!item
        )
      ),
      concat(
        a!forEach(
          items: local!notPresentList,
          expression: if(
            fv!isLast,
            fv!item,
            concat(
              fv!item,
              ","
            )
          )
        ),
        " is not present in data"
      )
    )

Reply
  • a!localVariables(
      local!referenceTableData: {
        "india",
        "usa",
        "Australia",
        "uk"
      },
      local!excelData: {
        "india",
        "usa",
        "Australi",
        "Iran"
      },
      local!notPresentList: a!forEach(
        items: local!excelData,
        expression: if(
          contains(
            local!referenceTableData,
            fv!item
          ),
          {},
          fv!item
        )
      ),
      concat(
        a!forEach(
          items: local!notPresentList,
          expression: if(
            fv!isLast,
            fv!item,
            concat(
              fv!item,
              ","
            )
          )
        ),
        " is not present in data"
      )
    )

Children