Need help on How to calculate Sum of a entity Column using UiPath Apps

Hi,

I have a entity table mapped to my UiPath app and I want to get the Sum of a entity column using UiPath Apps.
Thanks in advance for your kind reply.

image

Hi
Have a view on this thread on similar discussion

Cheers @Kavindu_Dilshan

1 Like

Follow this steps

  1. Create Data Service Connection (use the provided connection details).

  2. Retrieve Data (e.g., Get data from the Entity Table):

    • Data Service: Your Data Service
    • Entity Name: Name of the Entity Table
    • Filter: If you want to filter specific records
  3. Initialize a variable to store the sum, e.g., SumValue = 0.

  4. For Each (item in DataTable):

    • For Each: Data Table (Output from Retrieve Data)
    • Assign: SumValue = SumValue + Convert.ToDouble(item("ColumnName").ToString)
  5. After the loop, SumValue will hold the sum of the specified column.

  6. You can then use the SumValue in your UiPath workflow as needed.

  7. Finish and close the Data Service Connection when done.

@Kavindu_Dilshan

1 Like

Thanks @Palaniyappan ,

According to this, there is a issue with Sum function.
Correct me if I am wrong

Thanks @Praveen_Mudhiraj ,

This is using UiPath Studio, isn’t it?
I want to calculate the sum of a entity in the Apps level, (using any kind of functions) :frowning: .

Well they were trying to sum the column’s values in entity, but when referred them don’t appear nothing in screen.
They used a process to get the sum of column values
Hope my understanding is correct as per the comment from that post
@Kavindu_Dilshan

1 Like

CC: @Venkata_Rajendran
Hi @Venkata_Rajendran

Referring from How use Sum() function with columns of entities?.

Appreciate your kind input on this as well :slight_smile:

Hi @Kavindu_Dilshan

  1. Create an Entity Screen:
  • In UiPath Apps, create a screen for your entity by going to the “Entities” section and selecting your entity.
  • Configure the screen with the necessary filters and columns, including the column for which you want to calculate the sum.
  1. Add a Calculation Component:
  • In your entity screen, add a “Calculation” component. This component allows you to perform calculations on the data displayed in the screen.
  1. Configure the Calculation:
  • Configure the calculation component to calculate the sum of the desired column. Select the column from your entity that you want to sum.
  • Define the calculation as “Sum” or an appropriate mathematical function.
  1. Display the Result:
  • You can display the result of the calculation in a text field or label on your screen. Bind the text field or label to the result of the calculation.
  1. Test the Screen:
  • Save and test your entity screen to verify that it displays the sum of the column correctly.
  1. Publish and Use:
  • Once you are satisfied with your entity screen and the sum calculation, publish your app.
  • Users can then access the app and see the sum of the entity column when they interact with the screen.

Hi @vinitha_yachamaneni,

are you able to be a bit more specific about the calculation part of these instructions?

How do we access the field on the entity for the calculation component, and what is a calculation component? Is it a control for the app?

Thanks!