Condition if to compare the value of the row "def"

Good afternoon!
How to set a condition in an if so that it compares the value of the “def” row. If def is equal to urn: //x-artefacts-rosreestr-ru/outgoing/kvzu/7.0.1, then read and write write, otherwise display a message.


NamespaceKZVUandKVOKS.zip (57.7 KB)

Hello @sereganator,

read datatable use for each row
and in if condition row(“Column1”).toString.Trim.Equals(“def”) AND row(“Column2”).toString.Trim.Equals(“urn: //x-artefacts-rosreestr-ru/outgoing/kvzu/7.0.1”)

For each row where exactly to add?
Added an if condition to the for each row invoke method - it does not work correctly. Then I created another for each row after invoke, but it also does not work correctly. What am I doing wrong?

Hello @sereganator,

Place the if condition inside the for each row body and in put the condition as mentioned above.

Do not really understand. Please show me.

@sereganator Please refer the below image.

image


I can not put it after the Read Range, because after it there is a cycle for reading all files from the folder.

@sereganator,

Can you share the workflow? or else put the if condition in for each row as shown.

There are two files in the differentxml folder. One should write, the second should not write and display the message “different xml”.
NamespaceKZVUandKVOKSIf.zip (57.8 KB)

@sereganator

Please find the updated workflow NamespaceKZVUandKVOKSIf_Updated.zip (43.0 KB)

Does not work. Firstly, an error, and secondly, the message “xml diffrerent” should appear once, since there is only one xml file with a different structure. Can I set the type databasename.ror (value) = “value” in the if condition?

@sereganator Firstly that error is because you have mentioned wrong column name change the column name and it will fix it, secondly the message “xml different” appears more than once because you have developed it that way and I modified another part as per your requirement.

For your third query, If it means you want to find if that specify value exists anywhere in that column name of that datatable than yes it possble by below query

Yourdatatablename.AsEnumerable().Any(Function(x) x(“Yourcolumnname”).ToString.Contains('Yourvalue"))

It will return true if it finds that value anywhere in that datatable column

cheers!

Sorry, maybe I did not describe the problem correctly.
There are two xml files, as you can see their namespaces are different (highlighted in red). It is necessary that the program reads and writes data from these two files to the Excel table.
For the first xml file, I wrote what, where and how to extract, but to write for another xml file, it is necessary to set a condition for the program to read these two files.