Paste only values

Hello,

I’m utilizing the “Get from Clipboard” activity to save copied text and paste it into Excel. When it copies an empty value, it pastes the previously copied text. I want to avoid pasting the previously copied value when the current value is null. It should either skip pasting or move on to the next item.

I would appreciate your assistance.

Thank you in advance.

@Mohamed_Ameer1

  1. May I know from where are you copying the values?
  2. Can you show your flow please

Cheers

  1. I am copying from remote desktop and pasting it in excel.
    2.Flow is simple copying text from RDP → storing it in variable → using write cell I calling that variable.

Some of the fields are empty so while iterating what is copied last is pasting in excel.

@Mohamed_Ameer1

While copying are you using ctrl+c and the get clipboard?

Note:corrected shortcut

Cheers

Ctrl + c, using the keyboard shortcut → get from clipboard (assigning variable)

@Mohamed_Ameer1

One thing you can do is…store the value in a different variable also…and check if the previous value and the current value is same…and if so …make the variable empty else retain the value

  1. Get the value from clipbord and say saved to str
  2. Declare another variable prevstr…and initialize with empty string…string.Empty
  3. After get clipboard…use a if condition str = prevstr
  4. On then side use str = String.Empty and on then side do nothing…
  5. On then side prevstr = str

Thsi way if its same as prev…then empty will be given else…the value that is copied

Cheers

Thanks, will try out.

1 Like

The codition is not the checking the what is the latest copied value either it fails to write both the values in excel.I am getting empty cells as output.

@Mohamed_Ameer1

two issues I see here

  1. The scope of your variable is do…so the variable gets reset always the for loop iterates… so please change the scope to outside for loop…so that it does not reset always
  2. Dont use write cell directly in each side…because it is necessary to save the previous value to variable…and also auto incrment will not work if used twice in two different activities

so

  1. Change scope
  2. and codnition not sure if this the same youa re doing… currentvalue = previousvalue
  3. then side assign currentvalue = string.Empty
  4. on else side previousvalue=currentvalue
  5. use write cell after if condition with currentvalue as input value

cheers

Main.xaml (31.6 KB)

Can you please look into the flow, i have only do and sequence scope here, and also guide me the iterations as well.

@Mohamed_Ameer1

This is how it should be

trythis.xaml (32.3 KB)

cheers

Small question here, what is he internalNotes refering to as the previous copied value is OpenDate.
Please clarify :slightly_smiling_face:

After setting condition i am getting this error.
Screenshot 2023-10-14 232640
Please advise.

@Mohamed_Ameer1

  1. As per the get clipboard activities i saw only internalnotes is not assigned to anything and everything else is…so I assumed that is the previous value…you are storing…if not please change
  2. Can you please tell what you are referring to I see only a breakpoint

Cheers

Thanks working now :slightly_smiling_face:.

1 Like

@Mohamed_Ameer1

Glad it helped

Please close the topic if resolved

Cheers

Quick question : If the automation halts while capturing data midway and we need to restart it to complete the process, would the Excel range be adjusted due to the interruption? For example, suppose we are tasked with capturing 10 rows of raw data from RDP to Excel. If the automation stops at the 5th row for any reason, upon restarting, will it continue from where it left off, excluding the header rows?

Is there a method to resume the automation from the point of interruption?

:slightly_smiling_face:

@Mohamed_Ameer1

It wont automatically resume from there…it would ideally start from first again…

But if you need to restart from where it is failed…then add a new column status and check if status is filled or not…if filled then dont do anything if not extract data…this can be used as the first if condition and all the process can move to else side

Cheers

Example or flow please, i dont whether it will capture what is the latest activity happened?

@Mohamed_Ameer1

I hope your input is an excel file with rows of ticket numbers or whatever youa re going to search

if so…add a column as status in that excel and after reading each row just use write cell and write completed in status…

then in process use if condition to check the column first if status is filled or not

cheers

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.