Courseiva

CCNA Advanced Data Manipulation Questions

32 questions · Advanced Data Manipulation · All types, answers revealed

1
MCQmedium

You are performing a string manipulation to extract a sub-string. Which method is most performant when the string length is consistently large?

A.Use the Regex.Match activity.
B.Use a series of Split and array index operations.
C.Use the Substring method with calculated start and length indices.
D.Use the 'Replace' method to remove unwanted parts.
AnswerC

Substring is an O(1) operation (relative to the string size) that provides the most direct way to get a portion of a string. By using IndexOf to find boundaries and Substring for the extraction, you keep the memory and CPU usage minimal, which is essential for professional-grade, high-performance automation.

Why this answer

The Substring() method is highly optimized in .NET and is preferred for extracting parts of a string. When combined with IndexOf() or LastIndexOf() to locate delimiters, it allows for fast, memory-efficient extraction. This approach avoids the overhead of complex Regex processing.

In professional automation, choosing the most efficient method for the task is crucial to maintaining low latency and high execution speeds in high-volume data extraction scenarios.

Exam trap

Candidates often default to complex Regular Expression activities for basic string extraction tasks, introducing unnecessary performance overhead on large strings.

2
MCQhard

Which THREE of the following are valid ways to handle dynamic JSON keys when using the 'Deserialize JSON' activity?

A.Access properties using indexers: jObject("DynamicKey").ToString().
B.Use the 'SelectToken' method with a JSONPath string.
C.Cast the JSON object to a fixed class type.
D.Iterate through jObject.Properties() to find the specific key.
E.Use the 'Invoke Code' activity to call a Java-based parser.
AnswerA, B, D

The JObject indexer allows for string-based access to properties. This is the most straightforward way to handle keys that are determined at runtime. By passing the dynamic key as a variable string to the indexer, you can retrieve values without needing the property to be defined statically in the code.

Why this answer

When JSON keys are dynamic, static dot-notation fails. You must access fields using indexed notation (e.g., jsonObject('key')), use LINQ to filter the properties, or iterate through the JObject.Properties() collection. These methods allow you to access keys that are not known until runtime.

Mastering these techniques is essential for building robust automations that can integrate with evolving APIs where key names might change or be generated dynamically.

Exam trap

Candidates often assume dot-notation property access works for dynamic or unknown JSON keys, causing compilation or runtime binding failures when keys change.

3
MCQmedium

A developer is building a UiPath automation that processes a DataTable named dt_Orders. The DataTable contains a column 'OrderDate' of type String with values like "2023-04-15". The developer needs to filter rows where the order date is after January 1, 2023. Which approach correctly converts and filters the data?

A.Use the 'Filter Data Table' activity with the condition 'OrderDate' 'Is greater than' and provide a DateTime variable set to January 1, 2023. The activity will automatically convert the string column to DateTime.
B.Use a 'For Each Row' loop, convert each row's 'OrderDate' to DateTime using DateTime.Parse, and use an If activity to check if the date is after January 1, 2023.
C.Use the 'Select' method on the DataTable with a filter expression like "OrderDate > '2023-01-01'". This leverages the DataTable's built-in filtering capabilities.
D.Use the 'Filter Data Table' activity with a condition on the 'OrderDate' column, selecting 'Is greater than' and entering '2023-01-01' as a string.
AnswerB

Converting each string to DateTime with DateTime.Parse ensures proper chronological comparison. The If activity then accurately evaluates whether the order date is after the specified date. This approach is straightforward and works for any date format that DateTime.Parse can handle, making it reliable for this scenario.

Why this answer

The correct approach is to iterate through each row, convert the string date to a DateTime object using DateTime.Parse, and then compare it to the target date. This ensures chronological accuracy. Filtering a string column directly, whether via Filter Data Table or Select, performs lexicographical comparison, which is unreliable for dates.

Automatic conversion does not occur, so explicit parsing is necessary.

Exam trap

The trap here is assuming that the Filter Data Table activity or Select method will automatically interpret date strings correctly, when they actually perform string comparisons.

4
Multi-Selectmedium

A developer is working with a Dictionary(Of String, Integer) in UiPath to store counts of various transaction types. The dictionary is populated within a workflow. Which TWO statements are true regarding the behavior and manipulation of this dictionary? (Choose two.)

Select 2 answers
A.The 'Item' property can be used to both retrieve and update the value associated with a key.
B.Adding a duplicate key using the 'Add' method will overwrite the existing value without throwing an exception.
C.The 'TryGetValue' method returns the value if the key exists, and throws an exception if the key is not found.
D.Keys in the dictionary are automatically sorted in ascending order when iterating.
E.The 'ContainsKey' method checks if a specific key exists and returns a Boolean value.
AnswersA, E

The Item property (accessed via parentheses in VB.NET or brackets in C#) allows getting or setting the value for a key. If the key exists, it returns the value; if not, assigning creates a new entry. In this scenario, it can be used to increment counts by retrieving the current value and adding one, then assigning back.

Why this answer

ContainsKey and the Item property are fundamental for safe and efficient dictionary manipulation. ContainsKey allows checking existence before access, while the Item property enables retrieval and update. The Add method throws on duplicates, iteration order is not guaranteed, and TryGetValue does not throw exceptions for missing keys.

Exam trap

The trap here is confusing the behavior of Add with the indexer, and assuming dictionaries maintain sorted order.

5
MCQmedium

An automation developer is building a workflow that reads a CSV file into a DataTable named dt_Orders using the Read CSV activity. The 'OrderDate' column is currently stored as String. The developer needs to group all orders by month and compute a total per month using LINQ. Which approach correctly produces the monthly aggregation?

A.Use a For Each Row activity with an Assign that increments a Dictionary(Of String, Double), using the raw OrderDate string as the key.
B.Use dt_Orders.Compute("Sum(Amount)", "OrderDate") to calculate totals, since Compute groups automatically by the second argument.
C.Use dt_Orders.Select("OrderDate = 'yyyy-MM'") with the Select method to return grouped rows, then loop through them to total the amounts.
D.Use dt_Orders.AsEnumerable() with GroupBy(Function(r) DateTime.Parse(r("OrderDate").ToString()).ToString("yyyy-MM")) and then Sum on the parsed amount column.
AnswerD

GroupBy projects each DataRow into a month key derived from the parsed date, and Sum aggregates the numeric column per group. This is the standard LINQ-to-DataTable pattern and requires importing System.Data.DataSetExtensions so AsEnumerable() is available, plus System.Linq for GroupBy and Sum.

Why this answer

LINQ against a DataTable requires converting rows into an enumerable via AsEnumerable(), then applying standard operators. GroupBy with a month-formatted key and Sum over the amount column yields one aggregated result per month. The other options misuse filter-based APIs that cannot perform grouping, or aggregate at the wrong granularity.

Exam trap

The trap here is assuming DataTable.Select or DataTable.Compute can perform GROUP BY, when both only accept filter expressions and return flat rows or a single scalar.

6
MCQmedium

A developer needs to aggregate the total sales amount per region from a DataTable named dt_Sales, which has columns Region and Amount. The result must be a new DataTable with columns Region and TotalAmount, and the workflow must minimize memory usage and execution time. Which approach is the most efficient?

A.Use the 'Group By' LINQ query to group rows by Region, compute the sum of Amount for each group, and then use 'CopyToDataTable' to create the result DataTable.
B.Use the 'Aggregate' activity within a 'For Each Row' loop to compute the sum for each region, storing results in a Dictionary, then convert the Dictionary to a DataTable.
C.Use 'Build Data Table' to create an empty result table, then use 'For Each Row' to manually update the total for each region by searching the result table.
D.Use a 'For Each Row' activity to iterate through dt_Sales, and for each unique Region, use 'Filter DataTable' to sum the Amount values.
AnswerA

LINQ Group By performs aggregation in a single pass over the data, and CopyToDataTable efficiently materializes the results. This avoids repeated filtering and manual loops, reducing both execution time and memory overhead. It directly produces the required columns and handles large datasets well within a single activity.

Why this answer

The correct answer uses LINQ Group By to aggregate data in one pass, which is both time and memory efficient. CopyToDataTable then creates the required DataTable. This avoids iterative filtering or manual updates, making it ideal for large datasets and ensuring minimal resource consumption.

Exam trap

The trap here is assuming that looping with Filter DataTable or manual updates is acceptable for aggregation, but these methods scale poorly and are not optimized for grouping operations.

7
Multi-Selectmedium

A developer is working with a JObject variable named 'jsonObj' that represents a complex API response. Which TWO methods are valid ways to retrieve the value of a property named 'status' as a string?

Select 2 answers
A.jsonObj("status").ToString
B.jsonObj.SelectToken("status").ToString
C.jsonObj.Get("status")
D.jsonObj.Property("status").Value.ToString
E.jsonObj.Parse("status")
AnswersA, B

In VB.NET, the JObject class provides an indexer that allows you to access properties by their key name. This returns a JToken object representing the property value. Calling the ToString method on this JToken effectively converts the underlying JSON value into its string representation for use in the UiPath workflow.

Why this answer

Accessing JSON properties in UiPath using the Newtonsoft.Json library can be done through indexing or dedicated methods. Understanding these various access methods is crucial for handling dynamic JSON responses where properties might be nested or optional. Both the indexer and the SelectToken method are standard ways to interact with JObject and JToken structures in VB.NET.

Exam trap

Candidates often try to use standard Dictionary methods like TryGetValue directly on a JObject without realizing that while JObject implements IDictionary, the return types are JTokens. Another common error is forgetting to call .ToString() on the result, as the return type is typically a JToken, not a String.

8
MCQmedium

You are processing a large DataTable named 'dt_Inventory' and need to filter it to include only rows where the 'Status' column is 'Active' and 'Stock' is greater than 50. Which method is most efficient for a performance-optimized workflow?

A.Use a For Each Row activity and an If condition to add items to a new DataTable.
B.Use the Filter Data Table activity with the 'Remove' mode to delete unwanted rows.
C.Apply the .AsEnumerable().Where(Function(r) r("Status").ToString = "Active" AndAlso CInt(r("Stock")) > 50).CopyToDataTable() method.
D.Use a Select method with a SQL query syntax string directly on the DataTable object.
AnswerC

This LINQ expression efficiently filters the DataTable in-memory without row-by-row iteration. Using .AsEnumerable() converts the table to a queryable format, while .Where() applies the logic concurrently. This method is the industry standard for performance-critical data manipulation in UiPath, providing a clean, concise, and highly performant way to handle large datasets.

Why this answer

Using LINQ with the .Where() method is the standard for high-performance filtering in UiPath. It executes in memory, avoiding the overhead of iterating through rows using a For Each loop. This approach is critical when dealing with datasets containing thousands of records, as it reduces automation execution time and memory consumption significantly, ensuring the process remains responsive under load.

Exam trap

Candidates often use a For Each row loop combined with an If activity to filter large DataTables, severely degrading workflow performance compared to in-memory LINQ queries.

9
MCQhard

When updating a DataTable row, what is the impact of using the .BeginEdit() and .EndEdit() methods?

A.They enable asynchronous updates for better concurrency.
B.They prevent the DataRow from being modified by other threads.
C.They defer constraint checking and event firing until the update is complete.
D.They automatically save the changes to the underlying database.
AnswerC

These methods optimize row updates by grouping multiple changes together and deferring validation until EndEdit is called. This prevents the overhead of triggering constraints or events after every individual field modification, making it the most efficient way to perform bulk updates to a single row in a DataTable.

Why this answer

Using .BeginEdit() and .EndEdit() suspends event firing and constraint checking during the row update process. This significantly improves performance when performing multiple column updates in a single row. By preventing the DataTable from validating the row after every individual field change, you minimize unnecessary processing overhead.

This is a critical best practice for optimizing data manipulation in high-volume, performance-sensitive workflows where large rows are updated frequently.

Exam trap

Candidates often confuse BeginEdit and EndEdit with transaction rollbacks or assume they automatically save changes to a database, missing their true purpose of suspending events and constraint validations during bulk updates.

10
MCQeasy

A workflow receives a full customer name as a single string variable, for example 'Ada Lovelace', and must populate separate FirstName and LastName variables. The names always contain exactly one space separating the two parts, and surrounding whitespace may be present. Which expression correctly extracts the two parts?

A.fullName.Trim().Replace(" ", "") split into equal halves using the string length divided by two.
B.fullName.Trim().Split(" "c) assigned directly to the FirstName and LastName variables as an array.
C.fullName.Substring(0, fullName.IndexOf(" ")) for the first name and fullName.Substring(fullName.IndexOf(" ")) for the last name.
D.fullName.Split(" "c)(0) for the first name and fullName.Split(" "c)(1) for the last name, after trimming the input first.
AnswerD

Trimming removes any leading or trailing spaces, then splitting on the space character yields an array whose first element is the first name and second element is the last name, given the guaranteed single separating space. Indexing element zero and element one returns exactly the two parts. This uses standard String.Split semantics and is the straightforward, correct extraction for the stated input format.

Why this answer

Given a single separating space and possible surrounding whitespace, trimming first and then splitting on the space character yields an array with the first name at index zero and the last name at index one. Indexing those elements populates the two variables correctly. Substring variants mishandle the delimiter or assume equal lengths, and assigning the raw array is a type error.

Exam trap

The trap here is using the index of the space as the start of the last name, which leaves a leading space that quietly corrupts later comparisons.

11
MCQmedium

A developer is using a 'For Each' activity to iterate over a DataTable and needs to access the value of a column named 'Amount' for each row. The column may contain DBNull.Value for some rows. Which expression safely retrieves the amount as a Decimal, handling DBNull by returning 0?

A.Decimal.Parse(row("Amount").ToString())
B.CDec(row("Amount"))
C.row.Field(Of Decimal)("Amount")
D.If(row.IsNull("Amount"), 0D, CDec(row("Amount")))
AnswerD

This expression uses the If operator to check if the 'Amount' column is null via row.IsNull. If null, it returns 0D (Decimal zero); otherwise, it converts the value to Decimal using CDec. This safely handles DBNull and returns a Decimal, meeting the requirement.

Why this answer

The correct expression uses row.IsNull to check for DBNull and the If operator to return 0D when null, otherwise convert to Decimal. This safely handles null values and avoids exceptions. Other options either throw exceptions on DBNull or incorrectly parse the value.

Exam trap

The trap here is assuming that CDec or Field(Of Decimal) will automatically handle DBNull, when they actually throw exceptions.

12
MCQeasy

A developer is working with a DataTable that contains a column 'Price' of type String. The developer needs to calculate the total sum of all prices. Which approach is most appropriate?

A.Use the 'Compute' method on the DataTable with the expression 'SUM(Price)'.
B.Use the 'Aggregate' activity with the 'Sum' function on the 'Price' column.
C.Use LINQ in an 'Invoke Code' activity to sum the column directly.
D.Use a 'For Each Row' loop to convert each price to Double and accumulate the sum.
AnswerD

Since the 'Price' column is String, you must convert each value to a numeric type before summing. A 'For Each Row' loop allows you to parse each string to Double and accumulate the total. This is the most appropriate approach given the column's data type, ensuring accurate calculation without errors.

Why this answer

When a DataTable column is of type String, numeric aggregation functions cannot be applied directly. Converting each value to a numeric type within a loop is the correct approach. This ensures that the sum is calculated accurately and avoids runtime errors from type mismatches.

Exam trap

The trap here is assuming that the 'Compute' method can automatically convert string values to numbers, when it requires the column to already be numeric.

13
MCQmedium

Your team maintains a UiPath automation that reads pipe-delimited text files into a DataTable using Generate Data Table. Several files contain a literal pipe character inside quoted description fields, and downstream filtering by 'Region' silently returns wrong rows. Which change most reliably fixes the parsing without altering the source files?

A.Set the Generate Data Table column separator to a regex pattern that only matches pipes outside quotes, and enable the CSV parsing option.
B.Replace Generate Data Table with Read CSV configured with the pipe delimiter and the quote character, so quoted pipes are treated as data.
C.Keep Generate Data Table but first use String.Replace to remove every pipe character from the file content, then load the cleaned text.
D.Load the file with Generate Data Table as-is, then repair the shifted columns by shifting cell values back using a For Each Row loop.
AnswerB

Read CSV implements delimiter-and-quote-aware parsing: the delimiter and quote character are configurable, and delimiters enclosed in quotes are treated as literal data rather than field separators. Pointing it at the pipe-delimited file with the quote character set to the double quote keeps the 'Region' column aligned, which restores correct downstream filtering without touching the source files.

Why this answer

Quote-aware delimited parsing must happen when the file is read, because a pipe inside a quoted description is data, not a field boundary. Read CSV with an explicit delimiter and quote character honors that rule, keeping columns aligned so the 'Region' column holds the true value and downstream filtering works. Replacing delimiters, stripping pipes, or repairing columns after a bad parse all lose or corrupt data.

Exam trap

The trap here is assuming Generate Data Table can honor quoted delimiters because it accepts a custom separator pattern, when in fact quote-aware CSV semantics require Read CSV.

14
MCQmedium

An automation developer is building a UiPath workflow that reads a CSV file with thousands of rows using the 'Read CSV' activity. The 'Delimiter' property is left at its default. The CSV file uses semicolons as separators, and the first row contains column headers. After reading, the DataTable has only one column containing the entire row content. What is the most likely cause?

A.The 'ColumnNames' property must be set to the first row index to use headers.
B.The file encoding is incorrect, causing the parser to merge all columns.
C.The 'Read CSV' activity cannot handle files with more than 1000 rows.
D.The 'Delimiter' property must be set to a semicolon (";") to correctly parse the file.
AnswerD

The 'Read CSV' activity defaults to a comma delimiter. Since the file uses semicolons, the parser treats each entire line as one field, resulting in a single column. Setting the 'Delimiter' property to ";" allows the activity to split columns correctly. This is the direct cause of the issue and the appropriate fix for the scenario.

Why this answer

The 'Read CSV' activity uses a comma as the default delimiter. When the file uses semicolons, the activity fails to split columns, resulting in a single column containing the entire line. Setting the 'Delimiter' property to a semicolon resolves the issue.

This is a common configuration oversight when working with regional CSV formats.

Exam trap

The trap here is assuming that the 'Read CSV' activity automatically detects delimiters, when it actually relies on the explicitly configured 'Delimiter' property.

15
MCQhard

Which TWO methods are valid ways to add a new column to an existing DataTable?

A.dt.Columns.Add("NewColumnName", GetType(String))
B.dt.Rows.Add("NewColumnName")
C.dt.Columns.Insert("NewColumn")
D.Invoke Code with 'dt.Columns.Add("NewColumn")'
E.dt.AddColumn("NewColumn")
AnswerA, D

This is the standard and most efficient way to programmatically add a new column to a DataTable. It allows you to specify both the name and the data type of the column, ensuring the DataTable structure is updated correctly in memory for subsequent row-based data processing tasks.

Why this answer

Adding columns to a DataTable at runtime is a common requirement when enriching data during processing. Both the 'Add' method of the Columns collection and the use of 'Invoke Code' are valid ways to achieve this. Knowing these methods allows developers to dynamically expand data structures without needing to define complex schemas in the project design phase, increasing automation flexibility.

Exam trap

Candidates often assume that simply defining a variable is enough, forgetting that a DataTable requires a defined schema with column types before data rows can be added.

16
MCQmedium

Which of the following is the most appropriate way to handle null values when performing a calculation on a DataRow column?

A.Use row("Column").ToString = "" to check for nulls.
B.Use If row("Column") Is Nothing to check for nulls.
C.Use row.IsNull("Column") to check for null values.
D.Use a Try-Catch block to handle exceptions when calculating.
AnswerC

The .IsNull() method is specifically built into the DataRow class to identify DBNull values correctly. It is the most robust and readable way to handle missing data in DataTables. Relying on this built-in method prevents runtime errors and makes your logic clear to other developers maintaining the automation project.

Why this answer

Using the IsDBNull method is the safest way to check for null values in DataTables. DataRows often contain DBNull.Value instead of standard nulls, which causes errors if accessed directly in calculations. Always explicitly checking for DBNull ensures that your automation handles missing data gracefully, preventing runtime exceptions that would otherwise stop the process.

This practice is vital for building resilient automations that can handle inconsistent or incomplete input data sources effectively.

Exam trap

Test-takers frequently check for null values using standard string comparisons like Nothing or String.Empty, which fails because DataRows store database nulls as DBNull.Value.

17
MCQeasy

Which string method effectively removes leading and trailing whitespace from a variable?

A.myString.Clean()
B.myString.Trim()
C.myString.Strip()
D.myString.RemoveWhitespace()
AnswerB

The Trim method is the built-in .NET function that effectively removes all leading and trailing whitespace from a string. It is the standard approach for cleaning inputs before processing, ensuring that comparisons and conversions are not affected by hidden spaces or tabs that might be present in the source data.

Why this answer

Data cleaning is a standard task in RPA, where input data from OCR or web scraping often contains unwanted padding characters. The Trim() method is specifically designed for this purpose. Mastery of string manipulation is foundational for ensuring the accuracy of data comparisons, database updates, and inputting clean values into target applications, preventing common logic errors during automation execution.

Exam trap

Candidates often mistake Trim() for a method that removes internal whitespace, or they confuse it with Replace(" ", ""), which removes all spaces, including those between words.

18
Multi-Selectmedium

A developer needs to filter a DataTable named 'dt_Orders' to include only rows where the 'Priority' is 'High'. Which THREE methods can be used to achieve this in UiPath?

Select 3 answers
A.Using the 'Filter Data Table' activity
B.dt_Orders.Select("[Priority] = 'High'").CopyToDataTable()
C.dt_Orders.AsEnumerable().Where(Function(row) row("Priority").ToString = "High").CopyToDataTable()
D.Using the 'Lookup Data Table' activity
E.dt_Orders.Rows.Find("High")
AnswersA, B, C

The Filter Data Table activity is a built-in UiPath activity specifically designed for this purpose. It provides a wizard-based interface to define filter criteria and allows the developer to output the results to either the original DataTable or a new one. It is the recommended approach for simple filtering tasks due to its readability.

Why this answer

UiPath offers multiple ways to filter data, ranging from visual activities to programmatic methods. The Filter Data Table activity is the most accessible for beginners, while the Select method and LINQ offer more control for complex logic. Understanding when to use each method allows developers to balance ease of maintenance with execution performance in professional automation projects.

Exam trap

A common mistake is confusing the DataTable.Select method with LINQ. While they look similar, the Select method uses a string-based filter expression (DataView syntax), whereas LINQ uses lambda functions. Candidates also often forget that the Select method returns an array of DataRows, not a new DataTable.

19
MCQhard

A developer is parsing a large XML string returned by a SOAP service. The document contains a default namespace declared as xmlns="http://tempuri.org/". The developer uses an XDocument variable and writes doc.Descendants("Customer") to retrieve all Customer elements, but the result is empty even though the XML clearly contains Customer elements. What is the correct fix?

A.Call doc.Descendants().Where(Function(e) e.Name.LocalName = "Customer") to match on the local name only.
B.Remove the xmlns attribute from the XML string before parsing so the elements become unqualified.
C.Replace Descendants("Customer") with Descendants(XName.Get("Customer", "http://tempuri.org/")) so the query includes the namespace.
D.Convert the string to an XmlDocument and use GetElementsByTagName("Customer"), which ignores namespaces by default.
AnswerC

In LINQ to XML, element names carry their namespace. A bare string 'Customer' is treated as an empty namespace, so it never matches namespaced elements. XName.Get combines the local name with the namespace URI, producing the correct qualified name that matches the document's default namespace.

Why this answer

LINQ to XML compares element names including their namespace URI. A default xmlns puts every unprefixed element into that namespace, so an unqualified name string matches nothing. Supplying the namespace via XName.Get (or a namespace-aware query) makes the query resolve correctly without altering the source document.

Exam trap

The trap here is assuming a string element name matches regardless of namespace, when LINQ to XML requires the namespace to be part of the name match.

20
MCQhard

A developer needs to extract a specific value from a deeply nested JSON response returned by an API. The JSON structure includes arrays and objects, and the target value is at a path like $.data.items[0].details.id. The developer wants to avoid deserializing the entire JSON into a custom class. Which approach is most efficient and maintainable in UiPath?

A.Use the 'Deserialize JSON' activity to convert the JSON into a DataTable, then use DataTable methods to query the value by column names.
B.Use string manipulation functions like Substring and IndexOf to locate the value by searching for the key 'id' within the JSON string.
C.Use the 'Deserialize JSON' activity to convert the JSON into a JObject, then use the 'Select Token' activity with the path "$.data.items[0].details.id" to retrieve the value.
D.Use the 'Deserialize JSON' activity with the 'Deserialize JSON Array' option, then use a 'For Each' loop to iterate through the arrays and manually navigate to the target value.
AnswerC

The 'Deserialize JSON' activity creates a JObject that allows querying with JSONPath. The 'Select Token' activity can then extract the value at the specified path without needing a custom class. This is efficient because it only parses the JSON once and allows direct access to nested elements, making it maintainable for complex structures.

Why this answer

Using Deserialize JSON to create a JObject and then Select Token with a JSONPath expression is the most efficient and maintainable method. It avoids custom classes and allows precise extraction from nested structures. Other methods either require unnecessary iteration, cannot handle nesting, or rely on fragile string parsing.

Exam trap

The trap here is thinking that Deserialize JSON always requires a custom class, or that string manipulation is sufficient for extracting nested values.

21
MCQhard

Which TWO methods are most efficient for performing bulk updates on a DataTable containing over 50,000 rows without impacting workflow performance significantly?

A.Use a For Each Row in Data Table activity with an Update Row Item activity inside.
B.Use the AsEnumerable method with LINQ to update values in memory.
C.Use an Invoke Code activity to perform bulk updates using DataTable methods.
D.Use the Filter Data Table activity to split the table into chunks and process individually.
E.Use the Append Range activity to write the updated rows back to the Excel file.
AnswerB, C

AsEnumerable provides a performant way to query and update data within a DataTable using LINQ. By avoiding the overhead of the For Each Row activity, it allows for vectorized operations or batch updates that keep the workflow execution speed high, even when dealing with very large datasets.

Why this answer

Efficient data manipulation requires avoiding row-by-row iteration in large datasets. Using 'AsEnumerable' allows for LINQ-based operations which are optimized for memory usage. Alternatively, using an Invoke Code activity to execute C# or VB.NET logic directly on the underlying DataTable memory space bypasses the overhead of UiPath activity execution, significantly reducing processing time for high-volume data operations essential in enterprise-grade RPA solutions.

Exam trap

Many candidates try updating large datasets row-by-row inside standard For Each UI automation loops, causing extreme execution slowdowns on large files.

22
MCQmedium

Which THREE actions are best practices when using Dictionary<TKey, TValue> for large-scale data storage within a workflow?

A.Always initialize the dictionary using the 'New Dictionary(Of K, V)' syntax.
B.Use the 'ContainsKey' method to verify presence before accessing a key.
C.Use global variables for all dictionaries to ensure state persistence.
D.Use the 'Add' method to update existing key values within the loop.
E.Implement synchronization locks when modifying the dictionary in parallel activities.
AnswerA, B, E

Failing to initialize a dictionary results in a null object, which leads to a NullReferenceException when attempting to add or retrieve items. Explicit initialization ensures the collection exists in memory before any operations are performed, which is a fundamental requirement for working with reference types in VB.NET.

Why this answer

Dictionaries offer O(1) lookup time, making them superior to DataTables for key-based data retrieval. However, they are not thread-safe by default, so proper initialization and access patterns are critical. Using dictionaries effectively improves workflow performance and code readability, allowing developers to manage lookups efficiently without needing to re-scan large lists or tables repeatedly during runtime execution.

Exam trap

Candidates often forget to initialize dictionaries or fail to check if a key exists before retrieval, causing NullReferenceException or KeyNotFoundException errors.

23
MCQmedium

Which of the following is the most efficient way to merge two DataTables that have the same schema?

A.Use a For Each Row loop to copy values one by one.
B.Use the 'Merge Data Table' activity.
C.Use a LINQ query to join the tables and create a new one.
D.Write both tables to a CSV and use an 'Append' command.
AnswerB

The 'Merge Data Table' activity is the native UiPath wrapper for the DataTable.Merge method. It is the most efficient and readable way to combine two tables with the same structure. This activity is designed for high performance, ensuring that data is combined correctly while respecting primary keys and schema definitions.

Why this answer

The DataTable.Merge method is specifically optimized for this scenario. It handles data integration natively, including constraints and primary key handling. Using Merge is far more efficient than iterating through rows and manually importing them.

It reduces code complexity and minimizes potential errors, making it the standard best practice for synchronizing data between multiple sources in an automation workflow.

Exam trap

Test-takers frequently choose to manually loop through rows to copy data between identical schemas using ImportRow, ignoring the built-in Merge activity which handles this natively and efficiently.

24
MCQmedium

You are processing a large JSON string containing employee records. Which LINQ expression correctly extracts a list of names for all employees whose 'department' is 'Finance'?

A.JArray.Parse(jsonString).Select(Function(x) x("name")).Where(Function(x) x("department").ToString = "Finance")
B.JArray.Parse(jsonString).Where(Function(x) x("department").ToString = "Finance").Select(Function(x) x("name").ToString).ToList()
C.JArray.Parse(jsonString).Filter(Function(x) x("department") = "Finance").Map(Function(x) x("name"))
D.JObject.Parse(jsonString).Select(Function(x) x("name").Where(Function(y) y("department") = "Finance"))
AnswerB

This expression correctly parses the JSON into a collection, filters the elements where the department matches the string 'Finance', and projects only the name field. Converting to a list ensures the result is usable in subsequent activities like For Each or data table manipulation within the workflow.

Why this answer

Selecting data from JSON strings efficiently requires parsing the string into a JObject or JArray using Newtonsoft.Json. The LINQ 'Where' clause filters the collection based on the property value, while the 'Select' method projects only the required field. Mastering these transformations is crucial for handling complex API responses, reducing code complexity compared to traditional For Each loops, and ensuring high-performance data processing within large-scale UiPath automation projects.

Exam trap

Many test-takers try to query JSON strings using direct DataTable filtering activities without realizing the JSON must first be parsed into a LINQ-compatible object.

25
MCQmedium

A developer needs to extract a 10-digit account number from a string that always appears immediately after the phrase 'Account Number: ' and before the word ' (Active)'. Which Regex pattern is most appropriate for this specific extraction?

A.(?<=Account Number: )\d{10}(?= \(Active\))
B.Account Number: \d{10} (Active)
C.[0-9]{10}(?=Active)
D.(?<=Account Number: ).*(?=Active)
AnswerA

The syntax correctly uses a positive lookbehind to find the prefix and a positive lookahead for the suffix. The account number is targeted by the digit shorthand and quantifier. This ensures only the ten digits are returned in the match group, making the data immediately ready for use in subsequent activities.

Why this answer

Using Positive Lookbehind and Positive Lookahead ensures that the extraction is precise and does not include the surrounding anchor text in the result. In advanced automation, using zero-width assertions like these is preferred over simple matching because it eliminates the need for additional string trimming or sub-stringing after the Regex match is found.

Exam trap

A common mistake is including the anchor words inside the matching group, which forces the developer to manually strip the text later. Many candidates also forget to escape special characters like parentheses, which can lead to the Regex engine failing to match the terminating ' (Active)' string.

26
MCQmedium

Which sequence of operations is correct?

A.myList.Delete("Banana"); myList.Append("Date")
B.myList.Remove("Banana"); myList.Add("Date")
C.myList.RemoveAt("Banana"); myList.Add("Date")
D.myList.Pop("Banana"); myList.Push("Date")
AnswerB

The 'Remove' method effectively finds and deletes the specified value from the list, while the 'Add' method appends the new value to the end of the collection. This sequence correctly performs the requested transformation on the List object, maintaining the order of the remaining items properly.

Why this answer

List manipulation requires understanding the specific methods available for modifying collections. 'Remove' identifies the object to delete, while 'Add' appends to the end. Choosing the correct collection type (List vs. Array) is vital for efficient data handling.

Lists provide the necessary dynamic resizing capability, making them the preferred choice for scenarios where the number of items changes during the automation execution flow.

Exam trap

Candidates often confuse the Add method with Insert or mistakenly believe Remove requires an index instead of the object value, leading to syntax errors or incorrect collection states during runtime.

27
MCQmedium

When parsing a date string that follows an irregular format, which method provides the most control to avoid runtime conversion errors?

A.CDate(dateString)
B.DateTime.Parse(dateString)
C.DateTime.ParseExact(dateString, "yyyy-MM-dd", CultureInfo.InvariantCulture)
D.Convert.ToDateTime(dateString)
AnswerC

ParseExact requires an exact format match, giving the developer full control over the interpretation of the date string. By providing a specific format and invariant culture, it eliminates ambiguity, ensuring that the conversion succeeds only if the string matches the expected structure, which is vital for production-grade stability.

Why this answer

Parsing dates with non-standard formats requires explicit format providers to ensure the conversion is unambiguous. 'DateTime.ParseExact' allows developers to define the expected format string, which is critical when dealing with international data or legacy systems that do not follow standard ISO formats. This precision prevents unexpected date values and ensures the robustness of time-sensitive business logic in the automation process.

Exam trap

Candidates often use DateTime.Parse() without a format provider, which causes the automation to fail when the system's regional settings differ from the input date format.

28
MCQmedium

A developer needs to extract all email addresses from a large text string using a regular expression in UiPath. The pattern must match standard email formats. Which activity or method should they use to return all matches as a collection?

A.Use the 'Split' string method with the regex pattern as the delimiter.
B.Use the 'Find' activity from the Programming > RegEx category to locate the first match, then loop until no more matches are found.
C.Use the 'Matches' activity from the Programming > RegEx category, which returns a collection of Match objects.
D.Use the 'IsMatch' activity to check if the pattern exists, then use 'Replace' to extract the matches.
AnswerC

The Matches activity is specifically designed to find all occurrences of a regex pattern in an input string and returns an IEnumerable<Match>. It is the standard UiPath approach for extracting multiple matches and integrates seamlessly with other activities.

Why this answer

The Matches activity is the correct choice because it returns all regex matches as a collection of Match objects. It is efficient and designed for this purpose, unlike IsMatch, Split, or Find, which either do not return matches or return only the first match.

Exam trap

The trap here is confusing IsMatch with Matches; IsMatch only validates presence, while Matches extracts all occurrences.

29
MCQhard

You have a JSON string containing nested objects and arrays. Which TWO approaches are best for parsing this data into a usable format within UiPath?

A.Use the 'Deserialize JSON' activity and cast the output to a JObject.
B.Use a 'For Each' loop with String.Split to manually parse the JSON structure.
C.Use the 'Deserialize JSON Array' activity if the root element is a collection.
D.Use the 'Regex Match' activity to extract every field via named capture groups.
E.Convert the JSON to a DataTable using an Invoke Code activity.
AnswerA, C

The 'Deserialize JSON' activity is the native UiPath tool for converting JSON strings into structured objects. Casting to JObject allows for intuitive, dot-notation access to nested properties. This is the most reliable way to interact with complex payloads, ensuring that data types are maintained throughout the process workflow.

Why this answer

Parsing JSON requires robust handling of hierarchies. Using the 'Deserialize JSON' activity is the primary UiPath-native approach, providing access to JObject or JArray types. Alternatively, using 'Deserialize JSON Array' is essential when the root element is a collection.

These methods allow developers to use LINQ or index-based access to extract specific fields efficiently, which is vital for integration with complex REST API responses.

Exam trap

Many candidates incorrectly assume that the Deserialize JSON activity can automatically output a JArray when the root JSON element is a collection, leading to runtime type-casting errors.

30
MCQhard

A workflow builds an in-memory lookup of 200,000 customer records keyed by a 12-character alphanumeric account code, then performs about 400,000 existence checks during invoice matching. The current implementation uses a List(Of String) of account codes and calls .Contains for each check, and the job now runs for hours. Which change best addresses the performance problem?

A.Keep the List(Of String) but sort it once and call BinarySearch for each existence check.
B.Convert the List(Of String) to a String array and use Array.IndexOf for each existence check.
C.Load the account codes into a Dictionary(Of String, Boolean) and test existence with ContainsKey for each check.
D.Enable the 'Continue on error' property on the loop and wrap each check in a Try Catch so failed checks are skipped.
AnswerC

A Dictionary(Of String, Boolean) keyed by account code uses hashing to locate entries, giving near-constant average lookup time instead of a linear scan. Four hundred thousand ContainsKey calls against 200,000 keys complete in a fraction of the time the List.Contains loop requires, because each check touches roughly one bucket rather than every element. This directly removes the algorithmic bottleneck causing the multi-hour runtime while preserving the same matching logic.

Why this answer

The runtime is dominated by the algorithmic cost of scanning a 200,000-element list for each of 400,000 checks. Hashing the account codes in a Dictionary and testing with ContainsKey reduces each check to near-constant average time, eliminating the quadratic-style blowup. Changing collection types without changing the lookup algorithm, or adding error handling, leaves the fundamental cost untouched.

Exam trap

The trap here is assuming that swapping a List for an array or sorting for BinarySearch solves the problem, when only a hash-based lookup actually changes the algorithmic complexity.

31
MCQhard

A developer needs to combine data from two DataTables, dt_Orders and dt_Customers, based on a common column 'CustomerID'. The result should include all columns from both tables, and only rows where CustomerID exists in both tables. Which method is most appropriate and efficient?

A.Use a 'For Each Row' loop over dt_Orders and use 'Lookup Data Table' to find matching rows in dt_Customers.
B.Use the 'Merge Data Table' activity to combine the two tables.
C.Use the 'Filter Data Table' activity on both tables and then concatenate the results.
D.Use the 'Join Data Tables' activity with an Inner Join type.
AnswerD

The 'Join Data Tables' activity is designed to merge two DataTables based on a common column. An Inner Join returns only rows where the key exists in both tables, matching the requirement. It is efficient and handles the join operation natively. This is the most appropriate and efficient method for the scenario.

Why this answer

The 'Join Data Tables' activity with an Inner Join type directly performs the required operation: it combines columns from both tables and returns only rows where the key exists in both. It is optimized for performance and is the standard UiPath method for joining DataTables, avoiding manual loops or inefficient lookups.

Exam trap

The trap here is confusing 'Merge Data Table' with a join operation, when 'Merge' simply appends rows without key matching.

32
Multi-Selectmedium

A UiPath process reads a monthly sales workbook where each sheet uses the same layout but the sheet name is appended with the region, for example 'Sales_EMEA'. The workbook path and region are provided as arguments at runtime. You must extract every data row from the sheet matching that region and load it into a DataTable. (Choose two.)

Select 2 answers
A.Use Read Range with the Range property set to the region argument so that only cells whose content equals the region are returned.
B.Use the Filter Data Table activity with a condition on the region column, without specifying a sheet, to isolate the region's rows.
C.Use the Read Range activity inside an Excel Application Scope, setting the SheetName property to a dynamic expression that concatenates the 'Sales_' prefix with the region argument.
D.Use the Write Range activity with the region argument as the sheet name to normalize the workbook so all regions share a single sheet.
E.Use the Get Workbook Sheets activity to enumerate sheet names, then select the name whose suffix matches the region argument before reading it.
AnswersC, E

Read Range accepts a dynamically evaluated SheetName expression, so concatenating the literal prefix with the region argument targets the correct worksheet at runtime without hardcoding a name. Placing it inside an Excel Application Scope ensures the workbook is open and the sheet is resolvable. This satisfies the requirement to load the region-specific rows into a DataTable while keeping the automation reusable across regions by simply varying the argument value.

Why this answer

Reading the correct region sheet requires targeting it dynamically at runtime. Read Range accepts a dynamically built SheetName, and Get Workbook Sheets allows resolving the exact name when suffixes vary. Both approaches open the workbook through the Excel activities and yield the region's rows as a DataTable.

Specifying a range address, filtering before reading, or writing sheets do not perform the required read of the region-specific worksheet.

Exam trap

The trap here is confusing the Range property, which expects cell addresses, with the SheetName property, which is the one that accepts a dynamic sheet identifier.

Ready to test yourself?

Try a timed practice session using only Advanced Data Manipulation questions.