 # Replace a part of a string

Hello i have a string thats formulated Row_0
I want to perform a assignment to this string
Where i only change out the 0

Example everytime i go past that string i want to do the following Row_0 = Row_1
then if it goes past that string again ( in a loop or so ) change Row_2 etc

1 Like

@langsem Do you want to change the value inside the Variable ? i.e the value being Row_0 ?

the value its a string, but i want to make the string dynamic so i can change only the number. like increase the number after “Row_”

@langsem Yes. You can assign dynamic values to it. Create a Counter variable Initialised to 0 or 1.

Then use this when you’re performing the Operation “Row_”+counter.ToString

Then Increment the counter by one , counter = counter + 1

So The First time it will be “Row_0”, when it counter gets incremented and if you Check the value in the Second time it will be “Row_1” and it keeps on increasing until the iteration Stops

1 Like

hm, I have created a variable for the actual row

so i shall make another variable thats a int that i increase, then use a assign to mix those variables together ?

@langsem I think you’ll need to explain what you are actually trying to do haha okei.

So i have a program where i want a function that goes down the rows until its no more rows ( i know how to perform this, i am using a element exist with a flow decision and a assign ) but the problem its that the selector its not a index with a simple integer, its row its outputed Row_0, Row_1, Row_2 etc. So i would need to make a a variable upon that row and make it a string

@langsem Ok. i Think you can use the logic i have given. Then to use that value in the Selector since you’re using a different variable. Assign the Variable COUNTER_DBS_ROW = counter. ToString before it is being used in the Selector.

the variable COUNTER_DBS_ROW its Row_0
I would need to split tthat string to Row_

Then use another assign where i have a integer that i increase + 1

Then i have another assign where i combine those two ?

@langsem Use it in this way :

COUNTER_DBS_ROW = “Row_”+counter.ToString

hm the element exist still gives me false :S

@langsem Can you Show us how you have implemented the Workflow ?

@langsem Can you Hardcode the value in the Element Exists to Row_0 and Check if it works?

Also I think incrementing the counter should come after the Row Exists Sequence