Import validate or roll back

I have a 13-digit validation set as a regular expression. This means users can onli input numeric values and and must be excatly 13 digits.
[1]{13,13}$”
When I import I want to validate the import first.The system does not block it or allow rollback.Can anyone hlep.


  1. 0-9 ↩︎

Use the Row_Import server event to validate the data. Read:
https://aspnetmaker.dev/docs/#/customscripts.html?id=row_import

I am using page import, and even though it says failed, it is still adding to the table… and it’s not prevent anythingHere’s my code

// Row Import event
public bool Row_Import(Dictionary<string, object> row, int cnt) {
    //Log(cnt); // Import record count
    //Log(row); // Import row
    //return false; // Return false to skip import

if (Convert.ToString(row["My13digitNumber"]) == "^[0-9]{13,13}$") // Quantity must be <= 100
		return true; // Skip import
	
    return false;
}

Your checking is wrong. Use Regex.IsMatch to check the value against regular expression.

Thanks, got it fixed