cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Akobir
New Member

How increase variable in DataTable

Hi everyone!

Please help me.

For example, I have an excel-file with 2 columns, when the first column is key and second is count.

KeyCount
A0
B0
C2
D3

 

Next, in my process I calculate other variable. For example it will be equal "C"

 

I want to increase "Count" in my DataTable from 2 to 3. How can I do it?

 

Thank you in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
tkuehara
Solution Supplier
Solution Supplier

Hi @Akobir 

 

Are you trying to update a single value or the entire column?

 

Anyways, here's how to update a value in a data table variable:

Data table variable before update

tkuehara_0-1626952927214.png

Action to update a single value: %your_datatable_variable[row][column]%

tkuehara_1-1626952985584.png

Data table variable after update:

tkuehara_2-1626953070830.png

If this post helped you, please accept as solution

View solution in original post

4 REPLIES 4
DanielOlsson
Advocate I
Advocate I

Make a loop to check each row of data table, test this example. Note how we loop the table and look for a result.

 

1. Set variable %Row% =0

2. ( start a new loop here ) Loop Exceldata[%row%] as per your choice, could be until the last line of the table.  

3. Set variable Variable1 = Exceldata [%Row%]

4. IF statement in the loop, where IF Variable1 = C 

5. Message with box:  I found it %variable1% on row %row%

6. End of IF statement

7. increase variable row with 1

8. end 

 

Let it run and see what happens

 

tkuehara
Solution Supplier
Solution Supplier

Hi @Akobir 

 

Are you trying to update a single value or the entire column?

 

Anyways, here's how to update a value in a data table variable:

Data table variable before update

tkuehara_0-1626952927214.png

Action to update a single value: %your_datatable_variable[row][column]%

tkuehara_1-1626952985584.png

Data table variable after update:

tkuehara_2-1626953070830.png

If this post helped you, please accept as solution

View solution in original post

This is - what I need. Thank you!

Hi @tkuehara 

Maybe you know else, how can I sort my Data table by any 3-d column?

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (3,169)