How to copy data with some conditions?

Hello.

I need your help with the following:

  • I have the below database in excel file with multiple PO items allocated to one invoice.
  • How can I type the PO Item in a table, but keeping the unique “Invoice no., Date, Sum, Text” in the upper part of the application?
  • And after I copied all the PO items for the 1st invoice, to go to the next invoice number?

Thank you.
Ionut

Hi @ionut.petroiu

you can try like this

If Row(“Text”).ToString=""
Fill whatever row you want in the application
else
Move to entering new entries for new invoice

Regards
Sudharsan

1 Like

Hi

Hope the below steps would help you resolve this

  1. Use a excel application scope and pass the file path as input and use a read range activity and get the output as datatable dt

  2. Then use a for each row activity and pass dt as input

  3. Inside the scope use a IF condition like this

String.IsNullOrEmpty(CurrentRow(“Date”).ToString.Trim)

If true it goes to THEN block where leave it empty and if false it goes to else block where use type into activity with other column values as well

That’s it
As simple as that

Cheers @ionut.petroiu

1 Like

You need a variable for each column: Date, Sum, VAT code, and Text

Within your for each loop do the following:

if row(“Text”).tostring <> string.empty then
assign text = row(“Text”).tostring
assign date = row(“Date”).tostring
…etc

Use those variables in the type into activity. This will keep the variable the same as the previous row so long as the text column is blank

1 Like

@ionut.petroiu if the solution worked for you, would you kindly mark my post as the solution. Appreciate it!

Hi Greg,
I haven’t been able to test yet. I will come back next week with a feedback.
Thank you for your solution.

Hi Sudharsan,

I tried your solution today and I managed to do something which I think it works.
I have one more question, how can I push the “accept button” from an app in order to type into the data for the next invoice. What I do it was to play with the VAT code =“V9” like in the pictures.
Thank you very much.




image

1 Like

This is one of those times the first question you should ask is: can we get the source data in a better format?