4 Create Layouts in an Excel Workbook

To integrate a workbook with a REST service, create a layout for a business object on a new worksheet. You can then download data for the business object to the layout and start working with it.

Layouts

Oracle Visual Builder Add-in for Excel lets you create different layouts to work with data in an Excel worksheet. Layouts are a way to display a business object in an Excel worksheet. Each worksheet supports one of two layouts: Table or Form-over-Table.

  • Use a Table layout to view and edit data from a REST service in a tabular format. Here's a worksheet showing employee data in a Table layout:

  • Use a Form-over-Table layout when a parent-child relationship exists in the business objects used by your web application. Here's a worksheet showing purchase order and line data in a Form-over-Table Layout, where the parent object's data (Purchase Orders) is shown in the form and the child object's data (Lines) is shown in the table:

You can create one layout per worksheet in your Excel workbook. Layouts are created by workbook developers and are visible to data entry users in their workbooks.

Service Descriptions

To create a layout in the workbook, the REST services that you use must provide a service description that complies with the OpenAPI specification. The service description can be a URL or a local file. For Oracle business object REST API services, the URL typically includes a describe path segment, as in https://my-service-host/fscmRestApi/resources/latest/invoices/describe. For Oracle REST Data Services (ORDS), the URL may be similar to https://host/ords/great_app/open-api-catalog/employees/.

You can provide the service description document when you create a layout by clicking Designer in the Oracle Visual Builder tab, as described in subsequent sections. You can also provide the service description document by clicking Manage Catalogs in the Oracle Visual Builder tab (see Manage Catalogs and Business Objects).

The service description that you provide helps generate a business object catalog for the workbook. A business object catalog is essentially a list of business objects. As a workbook developer, you can edit portions of the business catalog as desired, or use it as is to create layouts.

Create a Table Layout in an Excel Workbook

Create a Table layout in the Excel worksheet when you want to view and edit data from a REST service in a tabular format.

When you create a table layout, you'll be prompted to point to the service description document. The service description document can be stored on your local drive or accessed remotely using a URL.

You'll also have the option to provide authentication details for accessing your REST service. Consult with your REST service owner for access requirements.

  1. Create a blank Excel workbook using the standard .XLSX file format or the macro-enabled .XLSM format. Other Excel formats (.XLS and so on) are not supported.
  2. In the Excel ribbon, select the Oracle Visual Builder tab.

  3. Click the cell where you want to locate the data table.
  4. In the Oracle Visual Builder tab, click Designer to launch the New Layout Setup wizard.Description of excel-apiinput.png follows
    Description of the illustration excel-apiinput.png
  5. From the first screen, provide the service description document using one of these options:
    • Web Address option (the default) if you access the service description from a URL. Note that you can't provide a data URL (a URL that returns data) as the starting point to creating a layout.
    • Select a file option if the service description document is a local file on your computer.

    Tip:

    If you are working with Oracle business object REST API services, the URL for the service description usually ends with /describe, for example, https://my-service-host/fscmRestApi/resources/<version>/purchaseOrders/describe.
  6. Select the authentication method for your service from the Authentication list and click Next.

    See Authentication Options for more information.

  7. If you selected OAuth 2.0 Authorization Code, enter the required properties and click Next.

    Required fields are outlined in red. Refer to OAuth 2.0 Authorization Code Flow for descriptions of the fields.

  8. Select a business object and click Next.

  9. Select Table Layout and click Next.

  10. Review the Table layout details and then click Finish.

    The add-in creates a Table layout in the Excel workbook that includes column headers and a placeholder data row. The Layout Designer opens in the Excel Task Pane.

    Note:

    If the origin cell of the layout is in the first 10 rows, the header row is frozen so that you always see the column headers when you scroll up and down in the worksheet. If desired, you can unfreeze the header row from Excel's View tab.
    Description of layout-designer-table.png follows
    Description of the illustration layout-designer-table.png
  11. Click the Columns tab in the Layout Designer to add or remove columns, or change the order in which columns appear. When a data table is created, most (but not all) fields are added as columns. Click the Manage Columns button (Manage Columns) to add or remove columns as needed.

    You can also modify a field associated with a column to, for example, show help text or display a list of input values for your business users. To update a field, select it from the Table Columns table and click the Edit button (Edit the selected column) to open the Business Object Field Editor. See Configure Business Object Fields.

    To add help text, click the General tab and type help text in the Help Text property. Help text is displayed when the user selects the table column header. To create a list of values, see Configure a List of Values with a Business Object.

  12. Optionally, configure the workbook further to limit the data that the add-in downloads, as described in Configure Search Options for Download.

The workbook is now complete and ready to be published. At this point, it's a good idea to perform various data operations, such as download, update, and upload, to test the workbook before you publish and distribute it to users. For information on managing data, see View and Edit Data Using an Excel Workbook in Managing Data Using Oracle Visual Builder Add-in for Excel.

Work with Service Path Parameters in a Table Layout

Some service paths include path parameters. The add-in provides support for configuring a Table layout using a parameterized service path. It automatically extracts the path parameters and prompts the user to provide the corresponding values at download time.

To configure a Table layout with a parameterized service path, first provide an OpenAPI-compliant service description. When prompted, choose a child business object or any parameterized path from the business object picker.

Tip:

When working with Oracle business object REST API services, you should start with the web address to the parent business object description (and not the child address). For example, for a parameterized service path such as /ExpenseReports/{ExpenseReports_Id}/child/Expenses/, provide the address to the ExpenseReports description (not Expenses). Oracle business object REST API services cannot provide OpenAPI service descriptions for parameterized service paths.

Complete the layout configuration. When users click Download Data in the Oracle Visual Builder tab, the add-in displays the Service Path Parameter Editor where users provide the required path parameter values that enables the download of data to complete.
Description of service_path_parameter_editor.png follows
Description of the illustration service_path_parameter_editor.png

Path parameters of type string or integer are supported; other data types are not supported. For string-typed path parameters, values that users enter in the Service Path Parameter Editor are used verbatim when the add-in constructs the request to the service. For integer-typed values, certain culture-specific formatting is removed (for example, commas for thousands separators, parentheses for negative). In all cases, the values used on the URL path are not URL-encoded, so the values entered must be acceptable by the REST service.

Here is an example of a service path with an embedded parameter:

/ExpenseReports/{ExpenseReports_Id}/child/Expenses/

Note {ExpenseReports_Id} is in the middle of the service path.

Using the Service Path Parameter Editor, you provide the proper value for {ExpenseReports_Id}, for example, 123456, which results in the add-in using the following path:

/ExpenseReports/123456/child/Expenses/

Accessing this service path will provide all the expenses for expense report 123456.

The Service Path Parameter Editor does not validate the value(s) that users enter. The value(s) that users provide must be valid. If the path includes multiple embedded parameters, the Service Path Parameter Editor prompts the user to provide a value for each embedded parameter.

The add-in remembers the values provided at download time. These values are used again at upload time to construct the upload requests. If you upload without having done a previous download (for example, when exclusively creating new rows), you'll be prompted for the path parameter values at the beginning of the upload.

Note:

Since business users may not know the path parameter values at download time, consider using a Form-over-Table layout or a set of dependent layouts instead. See Create a Form-over-Table Layout in an Excel Workbook or Use Multiple Layouts for Multi-level Business Objects.

Create a Form-over-Table Layout in an Excel Workbook

You can create a Form-over-Table layout in an Excel worksheet when a parent-child relationship exists in the chosen service.

A Form-over-Table layout can only be created for the top-level business object in a business object hierarchy. Suppose you have a hierarchy with three levels: purchaseOrders, lines, and schedules. In this hierarchy, purchaseOrders is a collection of top-level purchase orders each with one or more lines for managing the details of each order. Each of these lines may include one or more schedules for tracking shipping details.

In this scenario, you can only create a Form-over-Table layout for the purchaseOrders and lines business objects. You can't use lines for the form and schedules for the table in a Form-over-Table layout. See Use Multiple Layouts for Multi-level Business Objects.

A parent-child relationship at the service level requires:

  • A parent service path, for example, fscmRestApi/resources/1.0/purchaseOrders
  • A child service path with a parameter, for example, fscmRestApi/resources/1.0/purchaseOrders/{purchaseOrder-id}/child/lines

In your workbook, both business objects must be declared in the same catalog. Continuing our example, lines must appear as a child of purchaseOrders. To allow for data retrieval, updates, creation, deletion, and action invocation with the parent and child business objects using this layout, the service must expose the corresponding GET, PUT/PATCH, POST, and DELETE operations on these paths.

When you create a Form-over-Table layout, you may be prompted to point to the service description document. The service description document can be stored on your local drive or accessed remotely using an URL.

You'll also have the option to provide authentication details for accessing your REST service. Consult with your REST service owner for access requirements.

For information on Oracle REST Data Services (ORDS) requirements when creating Form-over-Table layouts, see the notes on ORDS support in Requirements for Dependent Layouts.

To create a Form-over-Table layout:

  1. Create a blank Excel workbook using the standard .XLSX file format or the macro-enabled .XLSM format. Other Excel formats (.XLS and so on) are not supported.
  2. In the Excel ribbon, select the Oracle Visual Builder tab.

  3. Click the cell where you want to locate the form and table.
  4. In the Oracle Visual Builder tab, click Designer to launch the New Layout Setup wizard.
  5. From the first screen, provide the service description document using one of these options:
    • Web Address option (the default) if you access the service description from a URL. Note that you can't provide a data URL (a URL that returns data) as the starting point to creating a layout.
    • Select a file option if the service description document is a local file on your computer.

    Description of excel-apiinput.png follows
    Description of the illustration excel-apiinput.png

    Tip:

    If you are working with Oracle business object REST API services, the URL for the service description usually ends with /describe, for example, https://my-service-host/fscmRestApi/resources/1.0/purchaseOrders/describe.
  6. Select the authentication method for your service from the Authentication list and click Next.

    See Authentication Options for more information.

  7. If you selected OAuth 2.0 Authorization Code, enter the required properties and click Next.

    Required fields are outlined in red. Refer to OAuth 2.0 Authorization Code Flow for descriptions of the fields.

  8. Choose the top-level business object for the form (in this case, purchaseOrders), and click Next.

  9. Choose Form-over-Table Layout, and click Next.

    The Form-over-Table layout option is unavailable if you didn't select the top-level business object or there is no available child business object.

  10. Choose a child business object (in this case, lines), and click Next.
  11. Confirm the details of your Form-over-Table layout, and click Finish.

    The add-in creates a Form-over-Table in the Excel worksheet and opens the Layout Designer that you use to modify the newly-inserted form and table, as shown here:
    Description of fot-result.png follows
    Description of the illustration fot-result.png

    If the form business object (in this case, purchaseOrders) supports a create action, a Create Form Row option appears in the Form Changes menu, as shown in the image. Use this option to create a new form row during your next upload (see Create a Parent Row in a Form-over-Table Layout in Managing Data Using Oracle Visual Builder Add-in for Excel).

  12. Customize the form and table by modifying the automatically populated properties in the Layout Designer.

    Use the Form page to add, remove, or rearrange fields on the form. The Table page includes the same functionality for the table under the form.

    Tip:

    From the Form or Table page of the Layout Designer, right-click a field or column to see choices for changing the order.

    To modify a form field or table column, select it from the table and click the Edit button (Edit the selected column) to open the Business Object Field Editor. From here, you can add a help text or a list of values to a field. To add help text, click the General tab and type help text in the Help Text field. Help text is displayed when the user selects a form field label or table column header. To create a list of values, see Configure a List of Values with a Business Object.

  13. Configure a search for the workbook to allow your business users to specify an item for the form, as described in Configure Search Options for Download. If you do not specify a value for the Search field or Row Finder property, the add-in downloads the first parent item it encounters in the REST service to the form, and the child items, if any, to the table.

Configuration is now complete and you can publish the workbook. At this point, it's a good idea to test the workbook before you publish and distribute it to users. For information on managing data in a Form-over-Table layout, see Manage Data in Form-over-Table Layouts in Managing Data Using Oracle Visual Builder Add-in for Excel.

Create Layouts for Attachment Business Objects

Create a table layout using an attachment business object that lets your business users upload and download attachments.

You can create a standalone table layout, the table layout of a Form-over-Table layout, or a table layout in a set of dependent layouts based on an attachment business object. You cannot use the form in a Form-over-Table layout.

Service Requirements

Oracle Visual Builder Add-in for Excel supports attachments in integrated workbooks if the REST service has:

  • An Attachment Record Business Object that contains the metadata for attachments, such as the attachment type, file name, and file size.
  • The following fields in the Attachment Record Business Object:
    • Type: A string field representing the attachment type. Valid values for this field are TEXT, FILE, and WEB_PAGE. These values are case-sensitive.
    • File Name: A string field representing the attachment file name. This field is used by text and file type attachments.
    • Url: A string field representing the attachment URL. This field is used by web page type attachments.
  • An Attachment Data Business Object that is a child of the attachment record business object and allows for the sending and receiving of attachments
When you create a table layout based on an attachment business object, the add-in can properly configure the layout as long as the attachment record business object includes:
  • An Attachment Data Business Object as a child business object with a path ending in /enclosure/FileContents; and,
  • Fields with field Ids of DatatypeCode (for the Type field), FileName (File Name), and Url (Url).

Configure an Attachment

If the workbook was created before version 2.8 of the add-in or the naming does not match, configure the attachment record business object manually from the Business Object Editor.

  1. Open the Business Object Editor for an attachment business object and click the Attachments tab.
    Description of attachment-bo-editor.png follows
    Description of the illustration attachment-bo-editor.png
  2. Select Is attachment.
  3. Click the Edit icon (Edit icon) next to Data Business Object to open the Choose a Business Object dialog.

    The dialog displays the paths for all child business objects for the Attachment Record Business Object.

  4. Select the required child Attachment Data Business Object from the list, then click OK.

    The child business object must support sending and receiving attachment data. This means that the child endpoint has a collection path that supports:

    • GET to retrieve attachment data
    • PUT to send attachment data
    • Request content type of application/octet-stream

    The path may be similar to this: {parent attachment record item path}/enclosure/FileContents.

  5. Click the Edit icon (Edit icon) next to Type Field to open the Available Business Object Fields dialog.
  6. Select the field to represent the attachment type, then click OK.

    This field must be a string field with valid values of TEXT (text type attachment), FILE (file type attachment), and WEB_PAGE (web url-based attachment). Typically, the field ID for this field is DatatypeCode.

  7. Use the available Edit icons to set the File Name and URL fields.
    Field Description
    File Name Field A string field representing the attachment file name. This field is used for text and file type attachments. Typically the field ID for this field is FileName.
    URL Field A string field representing the attachment URL. This field is used by web page type attachments. Typically the field ID for this field is Url.
  8. When finished, close the open editors using the Done buttons.

If properly configured, the resulting table layout includes a Local File Path column that keeps track of the location of local copies of attachments. Selecting cells in the table opens an attachment pop-up that can be used to interact with attachments. See Manage Attachments in Managing Data Using Oracle Visual Builder Add-in for Excel.



Known Limitations

  • See Service Requirements in this topic for the limitations on services that support this feature.
  • Binding an attachment record business object to the form portion of a form-over-table layout is not supported.
  • The only supported attachment types are file, text, and web page. The specific supported values for the field are TEXT, FILE, and WEB_PAGE. These values are case sensitive. Unknown attachment types are treated as file type attachments.
  • File download is not asynchronous and may make the UI appear frozen for large attachment files.
  • It is not possible to change the position of the Local File Path column in the table. It always appears at the end of the table before the Key column.
  • Manually editing the file path in the Local File Path column is not supported. The attachment pop-up should always be used to specify the local file location.
  • For some services, create may fail for text-based attachments. Ensuring all required attachment metadata, such as the Title, is present and resubmitting the record generally resolves this issue.
  • Attachment metadata records may have additional fields, such as DmDocumentId, UploadedFileContentType, that should generally be managed by the service and not altered by the business user. It is recommended that you mark these fields as read-only in the Business Object Editor if they aren't already or omit them from the table layout.

Use Polymorphic Business Objects and Fields

Oracle Visual Builder Add-in for Excel supports layouts for top-level polymorphic business objects as well as child business objects with a one-to-many relationship with its parent. For child objects in a one-to-one relationship, add descriptive flexfields (DFF) from the child to the parent layout.

About Polymorphic Business Objects

A polymorphic business object is a business object where the set of fields for a particular record differs based on the value of a discriminator field (also known as a context segment). In addition, a polymorphic business object includes a number of fields representing global or context-sensitive segments.Global segments are available for all values of the discriminator field, while context-sensitive segments are dynamic based on the value of the discriminator field. Descriptive flexfields (DFFs) are a type of polymorphic business object.

For example, an "Employees" business object may include a child polymorphic "Regional Information" business object that defines region-specific information for employee records. The Regional Information business object contains a "Region" field that acts as a discriminator field. It also contains global segments for all records, such as "Site" and "Time Zone", as well as context-sensitive segments such as a "Postal Code/Zip Code" for employees in the North American region.

Where and how a polymorphic business object can be used in a layout depends on its relationship with other business objects in the service. If the polymorphic business object is:

Use a Polymorphic Business Object in a Layout

You can create Table or Form-over-Table layouts for top-level polymorphic business objects as well as child business objects with a one-to-many relationship with their parent business object.

Before you begin, you can verify that a child business object is in a one-to-many relationship with its parent by checking the "cardinality" setting for a child business object. If this setting isn't set to "Many", the child polymorphic business object won't appear in the New Layout Setup wizard when you try to create a layout.

Note:

For child polymorphic business objects in a one-to-one relationship, add descriptive flexfields (DFF) from the child business object to a Table or Form-over-Table layout bound to the parent. See Add Descriptive Flexfields to a Layout.
  1. To check the cardinality setting for a child business object, open the Business Object Editor for the parent business object, then click the Children tab.


    Cardinality options are "One", "Many", or "Unknown". Only child business objects with a cardinality of "Many" (one-to-many relationship) can be used in a layout.

    Note:

    For workbooks created before Oracle Visual Builder Add-in for Excel version 3.2, the cardinality is set to "Unknown". This value behaves identically to a value of "One" for polymorphic business objects. The cardinality value does not impact the behavior of non-polymorphic business objects.
  2. Create a layout for a polymorphic business object as you do for other business objects. See Create Layouts in an Excel Workbook.
  3. If no polymorphic fields appear in the resulting layout, add the discriminator field to the layout from the Layout Designer.

Add Descriptive Flexfields to a Layout

You can add descriptive flexfields (DFF) to forms and tables using the Form Field Manager or Table Column Manager and place them anywhere in the form or table.Descriptive flexfields are a type of polymorphic business object that has a one-to-one relationship with its parent. See Overview of Descriptive Flexfields for more information on DFFs.

Note:

For polymorphic business objects in a one-to-many relationship, refer to Use a Polymorphic Business Object in a Layout instead.
  1. Open the worksheet with the layout that you want to modify.
  2. Click either the Form or Columns tab in the Layout Designer as needed.
  3. Click the Manage Form Fields or Manage Columns button (Manage Columns) to add your DFF.

    Available DFFs are identified by the title of the discriminator field (in this case, "Region") and appear at the bottom of the list of available fields. The field ID is the discriminator field ID ("__FLEX_Context").

  4. Select the DFF from the Available Fields list.

    You can also change the order of fields in the form or table by dragging and dropping fields in the Selected Fields list.

  5. Click Done.

    The associated segments appear in the layout in the following order: global segments, the discriminator, and context-sensitive segments.

Context-sensitive columns for all possible discriminator values are included in the table. However, only those cells in a row that are relevant to the value in the discriminator field are editable. All other context-sensitive cells are read-only (grayed out).



In a form, the context-sensitive form fields relevant to the current discriminator value appear after the discriminator field. Context-sensitive fields that are not relevant are not included in the form. If you change the value in the discriminator field, the form automatically updates to include the relevant context-sensitive field for that value.



Show or Hide Context-Sensitive Columns in a Table Layout

You can select which context-sensitive columns you want to display for a polymorphic business object, using the Polymorphic Information tab of the Business Object Field Editor.

All context-sensitive columns are shown by default. You may want to use this task to hide columns in a layout. For example, in the case of a Region polymorphic business object, you may choose to show regional information only for U.S. employees and hide it for all others.

To show or hide context-sensitive columns:

  1. Open the worksheet with the layout that you want to modify.
  2. From the Layout Designer, click the Edit icon (Edit) next to the Business Object field.
  3. From the Business Object Editor, click the Fields tab and then select the business object's field.
  4. Click the Edit icon (Edit) in the Business Object Editor to open the Business Object Field Editor.
  5. From the Polymorphic Information tab, select Limit discriminator values.
  6. To ensure you see all available discriminator values, click the Refresh icon (Refresh) to fetch the latest polymorphic metadata from the service.
  7. From the Discriminator Values list, select the discriminator values for the context-sensitive segment columns that you want to display. For example, to show zip code and state columns in your Table layout, select the United States check box and deselect all others.
  8. After you select or deselect discriminator values, close the open editors.

The layout displays the context-sensitive segment columns you selected.



Refresh Polymorphic Business Object Metadata

Clear polymorphic metadata when you publish a workbook to ensure the workbook gets the latest metadata. Oracle Visual Builder Add-in for Excel refreshes the polymorphic business object metadata during the first download operation performed after you open the published workbook.

Because polymorphic business object segments are configurable by customers and subject to change, metadata stored in the workbook may become stale.
To clear metadata when publishing a workbook, select Clear all layouts from the Publish Workbook window.

Polymorphic Support Limitations

Before creating layouts for polymorphic business objects or adding descriptive flexfields to a layout, review the limitations here:

  • A polymorphic business object is assumed to only contain a single discriminator field. Multiple discriminators are not supported.
  • The discriminator field must be a string.
  • When a polymorphic column or form field expands, the order is global segments, the discriminator, and then context-sensitive segments. Note that:
    • Changing the order of the global segments or context-sensitive segments is not supported.
    • Hiding specific global or context-sensitive segments is not supported.
  • In order to bind a polymorphic business object to a layout, it must expose polymorphic business object metadata. In an OpenApi3 describe document, this means that it must contain a "discriminator" and "oneOf" syntax in the schema for the business object. "anyOf" polymorphic business object syntax is not supported.
  • Hierarchical polymorphic business objects are not supported. All polymorphic segments must be defined directly on the polymorphic business object in the OpenApi3 describe document.
  • When a layout contains a polymorphic business object, the "fields" and "expand" query parameters should not be manually configured in the "Search Parameters" in the "Query" tab of the designer.
  • The add-in assumes that polymorphic fields appear in the metadata in the following order: global segments, discriminator, context-sensitive segments. If that is not the case, the add-in may fail to correctly determine which segments are global and which are context-sensitive.
  • The case where a child business object's fields are determined by a parent business object's discriminator value is not yet supported.
  • Limiting discriminator values for a polymorphic business object displayed in a Table layout does not limit:
    • The set of values that can be chosen in a list of values (LOV) for a discriminator field
    • The values users can provide for a discriminator field

Manage Layout Capabilities

Each layout in Oracle Visual Builder Add-in for Excel enables you to perform various standard and custom actions in an Excel workbook, so long as the operation is supported by your service. You can enable or disable these supported capabilities to control their availability in a layout.

  1. In the Excel ribbon, click Designer to open a workbook's Layout Designer.
  2. Click Advanced to see the layout's capabilities. Here's an example of a Form-over-Table layout, indicating form capabilities and table capabilities:

  3. Select or deselect options as required. If the business object doesn't support an action, it won't be available for selection (like Custom Actions Enabled in the example). See REST Operations for more information about the REST support required for these options.

Layout Limitations

Here are some things to keep in mind when creating layouts for your integrated workbook using Oracle Visual Builder Add-in for Excel:

  • Excel table objects, such as those created from the Excel ribbon using Insert > Table, are incompatible with the table layouts used by the add-in.
  • Do not save your workbook to the Excel 97-2003 workbook (.XLS) file format. Only the .XLSX and .XLSM file formats are supported. If you save to the .XLS format, the add-in disables commands in the Oracle Visual Builder ribbon.