One Common Email Different Excel fields

Hello everybody,

I didn’t know how to properly formulate my inquiry in one short search on the Forum, so please feel free to remove it if this creates a duplicate.

My question is how to send messages via email, in bulk, for customers with a specific code in the excel file.

I have an excel file and an orchestrator queue. All the information, line by line goes from excel to the Orchestrator, as a queue item.

When it comes to Send Outlook Activity, I’d like to group all transactions corrisponding to a certain customer, to be able to extract all information from the queue for that particular customer and build an email with details from queue items.

Process is supposed to be built with ReFramework, so general initialization\get transactions happen in corresponding parts of the state machine provided by UiPath.

Please, can someone share ideas on how to achieve this? Thanks

this can be achieved using References.

While reading the email, send the queue item with Reference that is unique to one user. May be you can have abbreviated names ending with digits.

Then while in get transaction state, first use the Get Queue Items, you’ll have all the queue items at once.

Then group them as per user names, then send one group at a time to Process Transaction state. In this was you’ll process one user data at a time

Grouping can ve done using linq or simply a for loop and if condition to group the same user reference

Remember, Get queue items is just to take the data at once and group
You’ll have to change the state of that transaction item manually once you process it

Hope this helps!

Let us know if you have any questions or concerns

1 Like

Hi @rahulsharma ,

Sorry, so I get the list of all the queue items on Orchestrator. Now I am going to iterate over the items with the help of “For each”. The queue is full of items and some elements have same ‘reference’. Can I group them? When I group them I can’t proceed with creation of an email just yet, can I?

This is actually what my Orchestrator queue looks like

Screen Shot 2021-10-21 at 5.44.27 PM

I am going to have to make something like that:

Get all transactions with the reference “X” and create one email.

Get all transactions with the reference “Y” and create one email.
…and so on.

Is this doable?

Yes it is doable.

I made a skeleton to showcase what I mention above.

I am sending queue Item 1,1,2,2,2

and after this workflow ends there will be grouped data 1,1 and 2,2,2

Queue Data Grouping.zip (11.2 KB)

1 Like

Thank you @rahulsharma ,
Even if I can’t know the IDs that will be uploaded to the Queue beforehand, will I be still able to use this approach?

Here’s my kind of input file. I am going to upload each line to the Orchestrator first. Then I want to send only one email to the recipient who has 123 code, and the second email will be sent to the 321 code. The tricky part actually is that I never know values in column 2, so I can’t build a dictionary, can I?

Screen Shot 2021-10-22 at 9.31.53 AM

that’s fine

we are referencing the data, that can be anything…

Whatever the data is, just send the reference for the part you want to group, ie., in your case Column 2 data and in collection, mention the remaining data

give a try to above skeleton. that’ll work

1 Like

Can I please see the Select statement in the second for each? Where you iterate over items in dtQueueData. Thanks

I attached the zip too in the previous reply, that will give you everything that is shown in the pic. :slight_smile:

Hope this will resolve the query

Sorry @rahulsharma, could we in theory get the inner fields out of the queue items this way by using in_Transaction argument?
Or how can this activity be adjusted to accept more fields, like TransactionItem.SpecificContent…?
image
Thank you.

you can still use the .SpcificContent function if you need to add more array elements

just add all of them after reference and separate them by comma

Something like this:

{queueItem.Reference.toString,queueItem.SpecificContent(“the specific content you need”)}

1 Like

We pass a string at the end of execution on to the output, which represents a table. So, when I print the values out, it actually writes it in form of a table.

Screen Shot 2021-10-25 at 3.31.58 PM

I am wondering if there is a way to deserialize that string, because the email message should be created, based on what is inside a queue item?

E.g " Hello, in_Transaction.SpecificItem(“Name”). "

Thank you.

that table content i just showed you to demonstrate it can be done, the values are with you. So you cna create the string by using them.

That datatable elements can be accessed using this syntax dt.Row(0)(0).toString

You can create a variable and concatenate all the data, something like this

"Hello " + dt.Row(0)(0).toString + “,” + Environment.Newline + Environment.Newline +…

1 Like

Thank you very much @rahulsharma for bearing with me, can you clarify please if the values in the table have to be explicitly accessed with number (e.g. dt.Row(0)(0).toString) or is there any way to get them differently?

I’d like to be able to access the value of transaction.specificitem(“first argument”) and so on… but the tricky part is that I don’t know the final number of records in filtered data table and might lose some data, am I wrong?

Screen Shot 2021-10-26 at 9.17.56 AM

1 Like