Why invoke code activity not working for replace function?

i have written code for replace the string but it cannot generate output
invoke code

u check syntax }

assign activity is working fine with that syntax and its generate desire output but invoke code is not working with this i just want to know why this is happening

Hi @vishal_jagtap1
use console.writeline(finaldata) \it prints the output in output panel
if it print the correct value as you expected then
set finaldata argument as In\Out
create another variable pass the finaldata argument


still same output not change in original string

Can you share your flow ??

not able to share it says new user not able to upload attachments

Ok share the input string you want to remove

“page”: 2,
“per_page”: 6,
“total”: 12,
“total_pages”: 2,
“data”: [
“{\r\n “id”: 7,\r\n “email”: “reqres”,\r\n “first_name”: “Michael”,\r\n “last_name”: “Lawson”,\r\n “avatar”: “/img/faces/7-image”\r\n}”,
“{\r\n “id”: 8,\r\n “email”: “reqres”,\r\n “first_name”: “Lindsay”,\r\n “last_name”: “Ferguson”,\r\n “avatar”: “himg/faces/8-image”\r\n}”,
“{\r\n “id”: 11,\r\n “email”: “reqres”,\r\n “first_name”: “George”,\r\n “last_name”: “Edwards”,\r\n “avatar”: “img/faces/11-image”\r\n}”,
“{\r\n “id”: 12,\r\n “email”: “reqres”,\r\n “first_name”: “Rachel”,\r\n “last_name”: “Howell”,\r\n “avatar”: “img/faces/12-image”\r\n}”
“support”: {
“url”: “reqres/#support-heading”,
“text”: “To keep ReqRes free, contributions towards server costs are appreciated!”

from above string i have to remove {\r\n by { using invoke code

finaldata1.txt (1.0 KB)


Are you getting any error. please assign one out argument and see you are able to get the output or not.

Output=finaldata.replace(your expression) and create out argument output.

Please refer the attached work flow i am able to replace the string in the text file. thanks.

ReplaceDemo.zip (2.8 KB)

1 Like

Hi @vishal_jagtap1

please find the xaml file , it works fine

test9.xaml (4.7 KB)

thanks @Robinnavinraj_S and @kirankumar.mahanthi1

Your welcome vishal.

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