Get data excel

Hello All

I have a question, how can I do this

I have an example

in column A and rows 1-5 contain “A,B,C,D,E”

in column A and rows 1-5 contains “1,2,3,4,5”

I want to make Output to Ms.Word like this
A1
B2
C3
D4
E5

thank you and please help me

actually i can get the data from excel but i can’t combine the data

hi @gilang_mandiri

Are these two different data tables?
Can you show in an excel?

@gilang_mandiri

  1. Read Data:
  • Read Range (Sheet1, A:A) → dataTableLetters
  • Read Range (Sheet1, A:A) → dataTableNumbers
  1. Create Word Document:
  • Word Application ScopewordDocumentVariable
  1. Combine Values:
  • For Each Row (in dataTableLetters):
    • Append Text (to wordDocumentVariable): row(“ColumnA”).ToString + dataTableNumbers.Rows(row.Table.Rows.IndexOf(row))(“ColumnA”).ToString + Environment.NewLine
  1. Save and Close Word Document:
  • Word Save Document (inside “Word Application Scope”)
  • Word Close Application (inside “Word Application Scope”)

Yes Sir the data is in a different excel table


and then i need to write in word like this

Hi @gilang_mandiri
→ Read Range Workbook


Output-> dt_Input
→ Please check the below query:

ListString= (From row In dt_Input.AsEnumerable()
   Select $"{row("Column1")}{row("Column2")}").ToList()

ListString is of DataType System.Collections.Generic.List(Of String)
→ Word Application Scope inside that use Append Text acitivity. Make sure to download UiPath.Word.Acitivities.
Output:


Workflow:

xaml:
Sequence3.xaml (9.6 KB)

Regards

Hi @gilang_mandiri

Try this


OutDT=(From row In InputDT.AsEnumerable()
                   Let combinedValue = row(0).ToString & row(1).ToString
                   Select outputRow = InputDT.Clone.Rows.Add(combinedValue)).CopyToDataTable()

String.Join(Environment.NewLine, OutDT.AsEnumerable().Select(Function(row) String.Join("", row.ItemArray)))

Input:

image

Output:

Note: Make sure Uncheck the Add headers in Read Range

Cheers!!

check the xml file


test case 5.xaml (8.9 KB)

thank u so much for the answer sir

thank u so much for the answer sirr

thank u so much for the answer sirrr

1 Like

thank u so much for the answer Sir

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