Update only not empty cell

Hi!
The sequence compares the “Cadastral (or conventional) number:” column, if the values ​​match, it updates the values ​​in the “Type of registered right” and “Total area” columns from the “result” file in the sample* files.
How to make sure that only non-empty cells are updated. For example, if the cell in the consolidated_DT database is not empty, then update, otherwise do not update
Main (3).xaml (14.9 KB)
sample5.xlsx (16.8 KB) sample3.xlsx (16.7 KB) sample (1).xlsx (16.7 KB) result.xlsx (19.5 KB)

1 Like

Hey @sereganator,

Before you try to update the cell in DT, make sure to make a check.

row("column") isNot nothing AndAlso string.isNullOrEmpty(row("column").ToString.Trim)

Cheers :slight_smile:

1 Like

Thanks, I did something like that. But there is still a question. The updated cells should turn green, but in the sample 5 file, the second line is updated, but not green. What could be the problem? Thank you.
Main (3).xaml (19.6 KB) sample5.xlsx (16.9 KB)
result.xlsx (19.6 KB)

1 Like

Does changing green is set in excel rules if I’m not wrong ?

Oh, sorry, third line. I also had to color the cells in the third line (since the value in the “Cadastral (or conventional) number:” column matched). What is wrong?
2020-12-29_19-44-22

1 Like

Could you please share the excel to check rules…

Else, Please share the rule screenshot.

Thanks :slight_smile:

The rules are:

  1. Compare the values ​​in the “Cadastral (or conventional) number:” column (excel file “result” - consolidated_DT database) with sample 5 file (output database). 2. If the values ​​match (the cell in the result file must not be empty), then insert the values ​​from the result file into sample 5 and color it in green. Coloring works on the second line, but not on the third.
    Before:
    After:
    File before: sample5.xlsx (16.7 KB)
1 Like

Where is that colouring rule present, could you please explain?

The set range color activity turns the updated columns green.

1 Like

Okay @sereganator, Got it.

So as I can see above, indexColorTypeRight is getting calculated in assign after set range colour. If I’m not wrong.

Could you please have that before set range color.

Thanks :slight_smile:

I did it, now it paints only the third line, the second does not.
I changed the counter value by default (set 2 or 1), it does not help. What is the problem? Thanks.


1 Like

What is the expression on the right side of the assign ?

index should be row index + 2

Why index should be row index + 2? You need to paint over each updated line, not across the line.
colour

1 Like

You are in the for-each row right, so your indexColorTypeRight should hold the row index value you are processing.

Thanks :slight_smile:

How to do it? Thanks.

1 Like

is it possible for you to share that xaml please ?

Of course)
Main (3).xaml (19.9 KB) result.xlsx (19.6 KB) sample5.xlsx (16.9 KB)

1 Like

Try this please @sereganator,

formatCheck.zip (3.7 KB)

Just added index output for second for-each row and indexColorTypeRight assign logic.

Thanks :slight_smile:

Does it work for you? Because I also color the cells incorrectly.

1 Like

I was not able to run it…

What issue you were facing ?