Randomizer Portugal Numbers is a specialized OutSystems library designed to generate statistically accurate and algorithmically valid synthetic data for the Portuguese context. It is an essential tool for developers and QA testers who need high-fidelity mock data that passes standard validation rules (Checksums).
GetRandomNIF
Generates a valid Portuguese Tax Identification Number (NIF).
Algorithm: Modulo 11.
Prefixes: Randomly selects from common prefixes (1, 2, 5).
Output: Value (Text) - 9 digits.
Value
GetRandomBI
Generates a legacy Identity Card number (BI).
Structure: 8 random digits + 1 check digit.
GetRandomUtente
Generates a National Health Service Number (SNS).
Prefix: Starts with "1".
GetRandomNIB
Generates a valid Bank Account Identifier (NIB).
Algorithm: Modulo 97 (ISO 7064).
Output: Value (Text) - 21 digits (19 random + 2 check digits).
GetRandomMobile
Generates a Portuguese Mobile Phone Number.
Prefixes: Randomly selects from 91, 92, 93, or 96.
GetRandomName
Generates a realistic full name based on Portuguese naming conventions.
Input: IsFemale (Boolean).
IsFemale
Logic: Combines 1 first name (from a pool of 400+) with 2 or 3 surnames (from a pool of 550+).
Output: FullName (Text).
FullName
GetRandomDOB
Generates a random Date of Birth.
Inputs: MinAge (Integer), MaxAge (Integer).
MinAge
MaxAge
Output: BirthDate (Date).
BirthDate
GetRandomCustomRange
Generates a random integer within a specific range.
Inputs: Min (Integer), Max (Integer).
Min
Max
Output: Result (Integer).
Result
GetWeightedBoolean
Generates a True/False value based on custom probability.
Input: TrueProbability (Decimal) - Range 0.0 to 1.0 (e.g., 0.7 for 70%).
TrueProbability
Output: Result (Boolean).
Architecture: All functions are implemented as Client Actions with the Function property set to Yes.
Function
Yes
Engine: Logic is processed via JavaScript Nodes to ensure high-speed calculation of checksums without server round-trips.
BigInt Support: The NIB generator utilizes BigInt for 64-bit integer precision during Modulo 97 calculations.
BigInt
Randomness: Uses the Math.random() PRNG (Pseudo-Random Number Generator).
Math.random()
Dependencies: Add the Randomizer Portugal Numbers producer to your consumer module.
Logic: Drag the desired action (e.g., GetRandomNIF) into your logic flow.
Expressions: Since they are functions, you can use them directly in Expressions or Assigns:
Var1 = GetRandomNIF()
Var2 = GetRandomName(IsFemale: True)
UI Data: For "Weighted Boolean", ensure you pass a decimal (e.g., Input_Percentage / 100) to the TrueProbability input.
Input_Percentage / 100
OutSystems Version: ODC (OutSystems Developer Cloud) and O11 (Reactive & Mobile).
Browsers: All modern evergreen browsers (Chrome, Firefox, Edge, Safari).
This component is intended for testing and development purposes only. While the numbers generated are algorithmically valid, they are synthetic and do not correspond to real individuals or accounts.