Using Library Object Functions

This topic describes sample projects that demonstrate how to use the new functions added to the library objects in version 7.1.

Using Date & Time Functions

The Format a Date to Given Valid Format, Add Hours, Add Minutes, and Convert Text to Datetime functions were added to the DateTime Library Objects. in version 7.1.

To view the functions:

1. Download the sample here.
2. Open the project and navigate to Presentation > Callouts select dateTimeFunc.

3. Select an action link, and then click on Insert an Action to view the functions.

4. Select Business Entities to view the user instances used in this project

5. Run the project and in the Quick callout, click on the links to execute the functions.
6. Open the Monitor to view the business entity values.

Using Excel Functions

The Get Excel Rows Count and Copy Rows from One Excel to Another Excel were added to MS Excel Functions Library Objects in version 7.1.

To view the functions:

1. Download the sample here.
2. Copy the Excel files to C:\APASamples.
3. Open the project and navigate to Presentation > Callouts select ExcelFunctions.

4. Select an action link, and then click on Insert an Action to view the functions. CopyExcelData copies the data from the source Excel to the destination Excel. ExcelRowCount counts the number of rows in the destination Excel.

5. Open srcExcel.xlsx to view the source Excel file. This is the data that will be copied.

6. Run the project and in the Quick callout, click on the links to execute the functions.
7. Open DestExcel.xlsx to view the destination Excel file. This is the data is pasted into the destination.

8. Open the monitor to view the countResult.

Using Get Response Header Value Function

The Get Response Header Value function was added in version 7.1. See Invoking a Web Service using an HTTP Request.

This sample will get the response header for: http://restapi.demoqa.com/utilities/weatherfull/city/pune.

To view the function:

1. Download the sample here.
2. Open the project and navigate to Presentation > Callouts select NewCallout.

3. Select the action link, and then click on Insert an Action to view the function.

4. Select Business Entities to view the user instance used in this project

5. Run the project and in the Quick callout, click on the link to execute the function.
6. Open the Monitor to view the business entity values.

Using Math Functions

The Abs, Ceiling and Floor functions were added to the Math Library Objects in version 7.1.

To view the functions:

1. Download the sample here.
2. Open the project and navigate to Presentation > Callouts select MathFunctions.

3. Select an action link, and then click on Insert an Action to view the functions.

4. Select Business Entities to view the user instances used in this project

5. Run the project and in the Quick callout, click on the links to execute the functions.
6. Open the Monitor to view the business entity values.

Using Outlook Functions

The Get All Unread Mail Items Using Folder Hierarchy, Get Mail Item Using Folder Hierarchy And Filter, Get Outlook Folder Mail Items Using Folder Hierarchy And Passed Filter and Get Unread Mail Items Using Folder Hierarchy And Oldest Date Limit functions were added to MS Outlook Functions Library Objects.

To view the functions:

1. Download the sample here.
2. Open the project and navigate to Presentation > Callouts select OutlookFunc.

3. Select an action link, and then click on Insert an Action to view the functions.
4. In order to use the sample project, update the functions to use your email address.

5. Send yourself several emails with the title: Sweets at my Desk.
6. Select Business Entities to view the user instances used in this project

7. Run the project and in the Quick callout, click on the links to execute the functions.
8. Open the Monitor to view the business entity values.

Using Text Functions

The Remove Spaces From String, Substring from Right of the String, Substring from Left of the String, Split by delimiters, Is Empty Or Has Spaces and Compare two Strings Ignoring Case functions were added to the Text Library Object in version 7.1.

To view the functions:

1. Download the sample here.
2. Open the project and navigate to Presentation > Callouts select New Callout.

3. Select an action link, and then click on Insert an Action to view the functions.

4. Select Business Entities to view the user instances used in this project

5. Run the project and in the Quick callout, click on the links to execute the functions.
6. Open the Monitor to view the business entity values.

Using Windows Functions

The Check if Windows Style Exists function was added to the Win 32 Operations Library Objectsin version 7.1.

For example, to check whether the style minimize is present in the given handle, specify 536870912, which is the decimal value for the style WS_MINIMIZE.

To find the decimal values for all the window styles find win32con.py online and look for the styles starting with WS_.

To view the function:

1. Download the sample here.
2. Open the project and navigate to Presentation > Callouts select New Callout.

3. Select an action link, and then click on Insert an Action to view the functions.

4. Select Business Entities to view the user instances used in this project

5. Open the sampleNotepad file in Notepad and minimize the window (this is because this sample tests if the window is minimized).
6. Run the project and in the Quick callout, click on the links to execute the functions.
7. Open the Monitor to view the business entity values.