PSIcapture Migration Troubleshooting: Configuration: Pad/lead 0’s within a numeric or string field

Problem:

When migrating a field, leading zeroes "0" are in front of a value when not intended.

 

Solution:

The Index Field must be a numeric field and you use Output format for the Field on Field Settings in the migration .  To pad to 6 characters you would use “D6” or “000000”.   If you leave the Index Field text your leading 0’s will never appear:

Script:
** Edit the field names and the number after the D is how many leading zeroes you want**

if (dataField.Name == "Digits")
				{
					int numericValue = 0;
					if(int.TryParse(dataField.StringValue, out numericValue))
						dataField.Value = numericValue.ToString("D10");
				}
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.