Dynamic variable(timestamp) to Json String not working

I have a json string like
jsonvariable = “{”“name”": ““Newbie Uipath””}"

I want to replace the “Newbie Uipath” to - year + “Newbie” +timestamp+ “Uipath” .
For that i have assigned paramName = year + “Newbie” +timestamp+ “Uipath”

Now im trying to replace the string

jsonVar = jsonvariable.Replace(“Newbie Uipath”, paramName)

but its giving name value as empty.Any help would be appreciated.

@john.teena After Replace Operation Check the jsonVariable value in a message box

1 Like

Done the same.The value of name is empty.
Is there anyother way to pass the timestamp in that json string?

@john.teena I guess you need to check the value of jsonVar :sweat_smile:, If jsonVar and jsonvariable are different variables

I checked the value of jsonVar only.Its giving only empty value for name key.
Its replacing the ‘Newbie Uipath’ value given in jsonvariable string to empty value.

@john.teena It is Strange :thinking:, Can you show me the Screenshot of what you are doing ?


This is the jsonvariable


This is what im getting after execution

@john.teena Why are you performing replace as a Default value :sweat_smile:

Sorry i didnt get what you are saying.

@john.teena Why aren’t you using Assign Activity to perform Replace operation?

Thank you so much!!! It worked !!
By the way why i cant give it as a default value.Its anyway replacing to a empty value.

@john.teena paramName will not be available at the beginning right, After you get the year and Timestamp, you combine it and then you assign it to paramName variable.

So at the beginning, when you execute the workflow, the Default values will be initialised first, but Since paramName is not initialised, it is Empty. Hence when you use replace operation in Default value , the “Newbie Uipath” will be replaced with Empty. So when you output the value, it will be blank. :sweat_smile:

1 Like

Yes yes now i understood.Thank you so much for your time :slight_smile:

1 Like

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