How to assign a Column value as IssueKey.CustomFields(“Project Name”).Values(0)
without using for each dt
assing a column value directly to a dt at the end append the dt to an existing excel
dataTable.Columns.Add("Project Name", GetType(String)).Expression = """Project Name"""
There are two scenarios here
- If it’s one row and one column
If you know the row column position of a datatable then use a assign activity like this
dt.Rows(rowindex)(“columnname”) = “your value”
Where rowindex starts as zero for first row
- If it’s all rows and one column
You need to write expression in Invoke Code activity.
dt = dt.AsEnumerable().ToList().ForEach(Sub(row) row(“ColumnName”) = row("ColumnName").ToString.ToUpper)
Note: Create one argument for Invoke Code activity and mention properties as below.
Name - dt
Direction - In
Type - DataTable
Value - dt
Hope this helps
Cheers @AbarnaKalaiselvam
dt.rows(0)(“PIN”) = IssueKey.CustomFields(“PIN”).Values(0)
Assign: Expression Activity type ‘VisualBasicReference`1’ requires compilation in order to run. Please ensure that the workflow has been compiled.
Change the project type as WINDOWS or WINDOWS LEGACY and give a try
When creating a project you will get an option to choose it
Cheers
Hi @AbarnaKalaiselvam ,
The Error is due to the Incorrect Double Quotes used, Re-Type the Double Quotes in the Expression (Not Copy Paste) and check :
dt.rows(0)("PIN") = IssueKey.CustomFields("PIN").Values(0)
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.