Share this page

# web_convert_from_formatted

Converts a string created with one or more data format extensions back to the source format.

Note: This function can be used if Data Format Extensions are enabled in the runtime settings.

For details about the data format extensions provided, and about the settings required to use this feature, see Virtual User Generator Help Center.

## C Language

int web_convert_from_formatted("FormattedData=<formatted_data_string>", "TargetParam=<parameter_name>", ["Extensions=<comma_separated_list_of_extensions>",] LAST );

Data Format Functions

## Java Language

int object.convert_from_formatted( const char *FormattedData, const char *TargetParam, String [] {"Extensions=<name>", "LAST"} );

Data Format Functions | Java Syntax

Argument | Description
--- | ---
FormattedData | The data to convert. If the Extensions argument is omitted, include the wrapping XML tags that specify the extensions. Additional information about the formatted data can be provided with Data Format Qualifiers.
TargetParam | The name of a parameter. The converted string will be saved in this parameter.
Extensions | A comma separated list of the names of the data format extensions that generated the formatted data. The extensions are listed in the reverse order to the order used to create the formatted string. The extension names are the values of the `ExtensionName` parameter from the extension INI files. For example, if the formatted data was generated by applying extension B on the output of extension A, the extension list is "A,B".
LAST | A marker indicating the end of the argument list.

## Return Values

This function returns LR_PASS (0) on success, and LR_FAIL (1) on failure.

## Parameterization

You cannot use standard parameterization for any arguments in this function.

## General Information

The web_convert_from_formatted function converts a string created with one or more data format extensions back to the source format.

This function can be used if Data Format Extensions are enabled in the runtime settings. For details about the data format extensions provided, and about of the settings required to use this feature, see the Virtual User Generator Help Center.

## Data Format Qualifiers

Formatted data can be qualified. Only one qualifier can be used. For formatted text, no qualifier is used. The qualifiers are:

FormattedData/EscapedBinary - The data is a null-terminated string containing binary code represented with escaped characters. This data is converted to binary before being passed to the first data format extension. See Binary Code.

FormattedData/BinaryParam - The data is the name of a parameter containing the formatted data in binary format.

## Example - C Language

This example shows a call to web_convert_from_formatted with the data format extension specified in the Extensions argument.

    web_convert_from_formatted (
    	"FormattedData=username=dfe&password=dfe&login.x=17&login.y=8",
    	"TargetParam=Param",
    	"Extensions=Base64",
    	LAST );

    This example shows a call to web_convert_from_formatted with the data format extension provided with the wrapping XML of the formatted data.

    web_convert_from_formatted (
    	"FormattedData="
        	"<LR_EXTENSION name=\"Base64 \">"
        	"username=dfe&password=dfe&login.x=17&login.y=8"
        	"</LR_EXTENSION>",
    	"TargetParam=Param",
    	LAST );

## Example - Java

This example shows a call to lrapi.web.convert_from_formatted with the data format extension provided with the wrapping XML of the formatted data.

convert_from_formatted

    lrapi.web.convert_from_formatted("FormattedData=" +
        "<LR_EXTENSION name=\"Base64\">test string</LR_EXTENSION>",
        "TargetParam=DFE_BODY", new String[]{
        "LAST"});

This example shows a call to lrapi.web.convert_from_formatted with the data format extension specified in the Extensions argument

    lrapi.web.convert_from_formatted("FormattedData=test string",
        "TargetParam=DFE_BODY", new String[]{"Extensions=Base64", "LAST"});

convert_to_formatted

    lrapi.web.convert_to_formatted("RawData=dGVzdCBzdHJpbmc=",
        "TargetParam=DFE_Param1",
        new String[]{"ChainName=c1", "LAST"});

Tips to improve your search results... VuGen Function Reference Version 26.1 Function Reference 26.1 All View Local Help Center View Online Help Center Version: