Replace the value not correct

Hi,

I need your help again. I am reading a column in Excel and would like to replace the value.

row(“Mandant”).ToString.Replace(“1”,“1001”).Replace(“11”,“2001”)

In Excel, if Mandant= 11, it does not replace it in 2001 but in 100120011001.

Can you give me a tiphere?

Thank you and best regards
Nina

Hi @nina.wenner

Can we have the input column screenshot?

Regards

Hi,

here a screenshot from the column:
image

Hi @nina.wenner

Could you please give us the below detail?

Input string: Assuming its 11
Expected Output after Replace 1 and 11 with respective values.

Your current flow is generating the below output.

image

Thank you.

Hi @nina.wenner

Please refer to the xaml below!

Find and replace test.xaml (10.6 KB)

Regards

Input string = 11 than we need 2001
Input string = 1 than we need 1001

I currently get the following result:
Input string = 11 = 1002001001 (it´s not correct)
Input string = 1 = 1001 (it´s correct)

Hi @pravin_calvin,

thanks it works. But there will be more mandanten (exampl. 5 = 1038), then it will be difficult via the if activity or?

Hi @nina.wenner

We can handle multiple Mandate as well.

I have created a DT with Mandate mapping as below.
image

Note: Please create an excel with mapping data as in the below and read it through read range during your actual implementation.

Updated Code:
Find and replace test.xaml (14.1 KB)

Please let me know your comments on this. Thank you.

2 Likes

Hi @Jobin_Joy, it works, thank you for your help.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.