Give us feedback
power-tools
Service icon

Power Tools

Stable version 1.0.1 (Compatible with OutSystems 11)
Uploaded on 12 October 2021 by 
5.0
 (1 rating)
power-tools

Power Tools

Documentation
1.0.1

Power Tools

Provides actions to manipulate character strings, to generate random numbers and to generate and validate Portuguese fiscal numbers (NIF).


Summary


Generator_Lib


ActionDescription
FiscalNumber_GenerateGenerates a fiscal number.
FiscalNumber_ValidateChecks if a fiscal number is valid.


Utils_Lib


ActionDescription
Email_ValidateChecks if an email address is valid.
RandomDecimalReturns a random decimal that is within a specified range.
RandomIntReturns a random integer that is within a specified range.
RoundAwayFromZeroRounds a number to the specified number of fractional digits.
SleepSuspends the current thread for the specified number of milliseconds.
String_CompareIgnoreCaseCompares two Strings lexicographically, ignoring case differences.
String_ContainsAnyChecks if the input string contains any of the received characters.
String_ContainsNoneChecks if the input string does not contain any of the received characters.
String_ContainsOnlyChecks if the input string contains only the received characters.
String_ContainsWhitespaceChecks if the input string contains any whitespace characters.
String_GetDigitsChecks if a string contains Unicode digits. If so, concatenates all the digits and returns them as a string.
String_GetLastCharReturns the last character of a string.
String_LastIndexOfFinds the last index (zero-based) of the search string on the input string.
String_RemoveEndRemoves a substring only if it is at the end of the source string, otherwise returns the source string.
String_RemoveLastCharRemoves the last character of a string.
String_RemoveStartRemoves a substring only if it is at the beginning of the source string, otherwise returns the source string.
String_RemoveWhitespaceRemoves all whitespace from a string.
String_SplitByStringSplits a string into individual elements delimited by the Delimiter string.
String_StripRemoves leading and trailing whitespace (space, tab, carriage return, line feed, form feed) from a string.
String_StripDiacriticsRemoves all accents from a string replacing the accentuated characters by non-accentuated ones.
String_TruncateReturns a string containing the first n characters of the given string, or the entire string if the input string length is shorter than n.
URL_DecodeConverts a string that has been encoded for transmission in a URL into a decoded string.


StructureDescription
TextStructure with single Text attribute


Actions


FiscalNumber_Generate

Generates a fiscal number.

Inputs

StartingDigits
Type: Integer. Mandatory.
The starting digits of the fiscal number.
CountryCode
Type: Text. Mandatory.
The country code of the fiscal number (ISO 3166-1 alfa-2).
IncludeCountryCode
Type: Boolean. Mandatory.
Flag indicating if the generated fiscal number should start with the country code.

Outputs

FiscalNumber
Type: Text.
The generated fiscal number.


FiscalNumber_Validate

Checks if a fiscal number is valid.

Inputs

FiscalNumber
Type: Text. Mandatory.
The fiscal number to validate.
CountryCode
Type: Text. Mandatory.
The country code of the fiscal number (ISO 3166-1 alfa-2).

Outputs

IsValid
Type: Boolean.
Flag indicating if the fiscal number is valid.


Email_Validate

Checks if an email address is valid.

Inputs

Email
Type: Text. Mandatory.
Email address to validate.

Outputs

IsValid
Type: Boolean.
True if the specified email is valid; otherwise, false.


RandomDecimal

Returns a random decimal that is within a specified range.

Inputs

MinValue
Type: Decimal. Mandatory.
The inclusive lower bound of the random number returned.
MaxValue
Type: Decimal. Mandatory.
The exclusive upper bound of the random number returned. MaxValue must be greater than or equal to MinValue.

Outputs

Result
Type: Decimal.
A double-precision floating point number greater than or equal to MinValue and less than MaxValue; that is, the range of return values includes MinValue but not MaxValue. If MinValue equals MaxValue, MinValue is returned.


RandomInt

Returns a random integer that is within a specified range.

Inputs

MinValue
Type: Integer. Mandatory.
The inclusive lower bound of the random number returned.
MaxValue
Type: Integer. Mandatory.
The exclusive upper bound of the random number returned. MaxValue must be greater than or equal to MinValue.

Outputs

Result
Type: Integer.
A 32-bit signed integer greater than or equal to MinValue and less than MaxValue; that is, the range of return values includes MinValue but not MaxValue. If MinValue equals MaxValue, MinValue is returned.


RoundAwayFromZero

Rounds a number to the specified number of fractional digits.

Inputs

Number
Type: Decimal. Mandatory.
A decimal number to be rounded.
DecimalPlaces
Type: Integer. Mandatory.
The number of decimal places in the returned value.

Outputs

Result
Type: Decimal.
The number closest to Number that contains a number of fractional digits equal to DecimalPlaces. If Number has fewer fractional digits than DecimalPlaces, Number is returned unchanged.


Sleep

Suspends the current thread for the specified number of milliseconds.

Inputs

MillisecondsTimeout
Type: Integer. Mandatory.
The number of milliseconds for which the thread is suspended.


String_CompareIgnoreCase

Compares two Strings lexicographically, ignoring case differences.

Inputs

Text1
Type: Text. Mandatory.
The string to compare from.
Text2
Type: Text. Mandatory.
The string to compare to.

Outputs

Result
Type: Integer.
< 0, 0, > 0, if Text1 is respectively less, equal or greater than Text2.


String_ContainsAny

Checks if the input string contains any of the received characters.

Inputs

Text
Type: Text. Mandatory.
The input string.
AllowedChars
Type: Text. Mandatory.
String containing the allowed chars.

Outputs

Result
Type: Boolean.
True if the input string contains any of the allowed chars.


String_ContainsNone

Checks if the input string does not contain any of the received characters.

Inputs

Text
Type: Text. Mandatory.
The input string.
InvalidChars
Type: Text. Mandatory.
String containing the invalid chars.

Outputs

Result
Type: Boolean.
True if the input string does not contain any of the invalid chars.


String_ContainsOnly

Checks if the input string contains only the received characters.

Inputs

Text
Type: Text. Mandatory.
The input string.
AllowedChars
Type: Text. Mandatory.
String containing the allowed chars.

Outputs

Result
Type: Boolean.
True if the input string only contains allowed chars.


String_ContainsWhitespace 

Checks if the input string contains any whitespace characters.

Inputs

Text
Type: Text. Mandatory.
The input string.

Outputs

Result
Type: Boolean.
True if the input string contains any whitespace characters.


String_GetDigits

Checks if a string contains Unicode digits. If so, concatenates all the digits and returns them as a string.

Inputs

Text
Type: Text. Mandatory.
The string to extract digits from.

Outputs

Result
Type: Text.
String with only digits, or an empty string if no digits were found.


String_GetLastChar

Returns the last character of a string.

Inputs

Text
Type: Text. Mandatory.
The input string.

Outputs

Result
Type: Text.
The last character of the input string.


String_LastIndexOf

Finds the last index (zero-based) of the search string on the input string.

Inputs

Text
Type: Text. Mandatory.
The input string.
SearchText
Type: Text. Mandatory.
The string to search for.

Outputs

Result
Type: Integer.
The last index of the search string on the input string.


String_RemoveEnd

Removes a substring only if it is at the end of the source string, otherwise returns the source string.

Inputs

Text
Type: Text. Mandatory.
The source string to search.
Remove
Type: Text. Mandatory.
The string to search for and remove.

Outputs

Result
Type: Text.
The substring with the string removed, if found.


String_RemoveLastChar

Removes the last character of a string.

Inputs

Text
Type: Text. Mandatory.
The input string.

Outputs

Result
Type: Text.
The input string without the last character.


String_RemoveStart

Removes a substring only if it is at the beginning of the source string, otherwise returns the source string.

Inputs

Text
Type: Text. Mandatory.
The source string to search.
Remove
Type: Text. Mandatory.
The string to search for and remove.

Outputs

Result
Type: Text.
The substring with the string removed, if found.


String_RemoveWhitespace

Removes all whitespace from a string.

Inputs

Text
Type: Text. Mandatory.
The input string.

Outputs

Result
Type: Text.
The input string without all whitespace.


String_SplitByString

Splits a string into individual elements delimited by the Delimiter string.

Inputs

Text
Type: Text. Mandatory.
The string to be split into individual strings.
Delimiter
Type: Text. Mandatory.
Contains the string considered as the separator.

Outputs

Result
Type: RecordList of Text .
List of strings that results from splitting the original string.


String_Strip

Removes leading and trailing whitespace (space, tab, carriage return, line feed, form feed) from a string.

Inputs

Text
Type: Text. Mandatory.
The input string.

Outputs

Result
Type: Text.
The input string without leading and trailing whitespace (space, tab, carriage return, line feed, form feed).


String_StripDiacritics

Removes all accents from a string replacing the accentuated characters by non-accentuated ones.

Inputs

Text
Type: Text. Mandatory.
The input string.

Outputs

Result
Type: Text.
The input string without accents.


String_Truncate

Returns a string containing the first n characters of the given string, or the entire string if the input string length is shorter than n.

Inputs

Text
Type: Text. Mandatory.
The input string.
Length
Type: Integer. Mandatory.
Length of the truncated string.

Outputs

Result
Type: Text.
Truncated string.


URL_Decode

Converts a string that has been encoded for transmission in a URL into a decoded string.

Inputs

Url
Type: Text. Mandatory.
The string to decode.

Outputs

Result
Type: Text.
The decoded string.


Structures


Text

Structure with single Text attribute

Attributes

Value
Type: Text (50). Mandatory.