I thought this issue was resolved by recreating the variable like suggested before but it did not resolve my issue. Unless I misunderstood your previous recommendation @Anil_G (Modify Text Activity Error). We are on Studio version 24.10.10
I am getting the below error after upgrading the UiPath.Systems.Activity package to 24.10.7. Its failing at the Modify Text activity. After downgrading back to UiPath.Systems.Activity package 22.10.6 the error cleared. I have tried 23.10.x, 24.10.x, and 25.2.1. Always fails unless downgrade back to 22.10.6.
If I just use an assign activity and use: fileName.Replace("", ââ).Trim - It works just fine.
Odd that the Modify Text Activity would not work the same.
Other thought, would a persistent activity further down the workflow cause an issue like this?
System.Exception: Type âUiPath.Core.Activities.TextModifications.FindAndReplaceTextModificationModelâ cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. Alternatively, you can ensure that the type is public and has a parameterless constructor - all public members of the type will then be serialized, and no attributes will be required. â> System.Runtime.Serialization.InvalidDataContractException: Type âUiPath.Core.Activities.TextModifications.FindAndReplaceTextModificationModelâ cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. Alternatively, you can ensure that the type is public and has a parameterless constructor - all public members of the type will then be serialized, and no attributes will be required. at System.Runtime.Serialization.DataContracts.DataContract.DataContractCriticalHelper.ThrowInvalidDataContractException(String message, Type type)
May I know if filename is an object type or string?
As the error seems to be more with persistent activities as you rightly pointed..non serializable variables cannot be used
If the variable is string then we can try isolating this into a separate workflow or sequence so that its not in the persistent scope to see if the activity in different scope is causing the issue or not
Yes, this is an error due to use of Persistence. Certain types of variables cannot be serialized. Serialization is what happens when the job suspends. Itâs how the variablesâ values are saved so they can be reinstated when the job resumes. You have to make sure itâs not in the same scope as the wait activity.
I donât think itâs an error with one of your variables. I think itâs an error with a variable or something inside the Modify Text activity. Thatâs why it works on an older version.