# New Service Dialog Editor

CloudForms 4.6 (ManageIQ *Gaprindashvili*) has introduced a new drag-and-drop service dialog editor.

The dialog editor is invoked through the **Automation -> Automate -> Customization** menu, and from the **Configuration** button (see screenshot [Adding a New Dialog](#i1)).

![Adding a New Dialog](https://49669005-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGPjFJQMOoGonN-rIX1%2F-LJnZ0-vk-gQ2oiMXmhJ%2F-LJnZ0qsZrjqqDq3TeVV%2Fscreenshot1.png?generation=1534168417088368\&alt=media)

## Creating a New Dialog

The empty dialog editor displays the list of possible element types as a vertical column along the left-hand side of the editor (see screenshot [Empty Dialog Editor](#i2)).

![Empty Dialog Editor](https://49669005-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGPjFJQMOoGonN-rIX1%2F-LJnZ0-vk-gQ2oiMXmhJ%2F-LJnZ0qxQu2eEuL9xX84%2Fscreenshot2.png?generation=1534168413906993\&alt=media)

The empty dialog "canvas" can be designed as required. New tabs or sections can be created by clicking the **Create Tab** or **Add Section** links.

### Adding Elements

Elements are added to the dialog by dragging from the sidebar and dropping onto the appropriate section (see screenshot [Dragging a Text Box onto the Dialog](#i3)).

![Dragging a Text Box onto the Dialog](https://49669005-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGPjFJQMOoGonN-rIX1%2F-LJnZ0-vk-gQ2oiMXmhJ%2F-LJnZ0r-SrbPbRUeo8o_%2Fscreenshot3c.png?generation=1534168415270311\&alt=media)

Multiple elements can be reorganised within a section by dragging and releasing (elements cannot be dragged between sections).

### Editing Elements

Element details can be edited by clicking on the pen icon on the right of the element (see screenshot [Editing an Element](#i4)).

![Editing an Element](https://49669005-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGPjFJQMOoGonN-rIX1%2F-LJnZ0-vk-gQ2oiMXmhJ%2F-LJnZ0r1zhBsIq7sCpl9%2Fscreenshot4.png?generation=1534168410472746\&alt=media)

#### Field Information Tab

The **Field Information** tab contains entry fields for general information, and a slider to determine whether or not the element is to be populated dynamically (see screenshot [Field Information Tab](#i5)).

![Field Information Tab](https://49669005-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGPjFJQMOoGonN-rIX1%2F-LJnZ0-vk-gQ2oiMXmhJ%2F-LJnZ0r5N6XQ7unwC0GD%2Fscreenshot5.png?generation=1534168416266729\&alt=media)

#### Options Tab

The **Options** tab contains entry fields, sliders and drop-down selections that define the element characteristics (see screenshot [Options Tab for a Static Element](#i6)).

![Options Tab for a Static Element](https://49669005-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGPjFJQMOoGonN-rIX1%2F-LJnZ0-vk-gQ2oiMXmhJ%2F-LJnZ0rHyH71nHTzNuFt%2Fscreenshot6.png?generation=1534168423050094\&alt=media)

#### Advanced Tab

The **Advanced** tab allows an element to be defined as **Reconfigurable** if required (see screenshot [Advanced Tab](#i7)).

![Advanced Tab](https://49669005-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGPjFJQMOoGonN-rIX1%2F-LJnZ0-vk-gQ2oiMXmhJ%2F-LJnZ0rJuFb8bt8vodpG%2Fscreenshot7.png?generation=1534168425214352\&alt=media)

### Dynamic Element Fields

If the **Dynamic** slider in the **Field Information** tab is switched to **Yes**, the available options in the **Options** tab change and some are moved to a new **Overridable Options** tab (see screenshots [Options Tab for a Dynamic Element](#i8) and [Overridable Options Tab](#i9)).

![Options Tab for a Dynamic Element](https://49669005-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGPjFJQMOoGonN-rIX1%2F-LJnZ0-vk-gQ2oiMXmhJ%2F-LJnZ0rMafU3sv3ML2Gp%2Fscreenshot9.png?generation=1534168423072850\&alt=media)

#### Overridable Options Tab

![Overridable Options Tab](https://49669005-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGPjFJQMOoGonN-rIX1%2F-LJnZ0-vk-gQ2oiMXmhJ%2F-LJnZ0rOkKw4IJ1EM9XH%2Fscreenshot8.png?generation=1534168411005357\&alt=media)

Element options on the **Overridable Options** tab can be overridden programmatically from the dynamic method, if required.

#### Entry Point Field

The **Entry Point** field on the **Options** tab presents an Automate Datastore browser that can be used to select the dynamic method to populate the element values at run-time (see screenshot [Selection of Method to Populate Dynamic Element](#i10)).

![Selection of Method to Populate Dynamic Element](https://49669005-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGPjFJQMOoGonN-rIX1%2F-LJnZ0-vk-gQ2oiMXmhJ%2F-LJnZ0rQL3SmCfjUjvUA%2Fscreenshot10.png?generation=1534168425146665\&alt=media)

### Optional Help

The **Field Information** tab contains a **Help** box that can be used to populate an informational message when the dialog is run (see screenshot [Setting Help Text](#i11)).

![Setting Help Text](https://49669005-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGPjFJQMOoGonN-rIX1%2F-LJnZ0-vk-gQ2oiMXmhJ%2F-LJnZ0rSPnAw7L8N7uFX%2Fscreenshot11.png?generation=1534168409959267\&alt=media)

When the dialog is run the help text is available from the *i* icon (see screenshot [Displaying Help Text](#i12)).

![Displaying Help Text](https://49669005-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGPjFJQMOoGonN-rIX1%2F-LJnZ0-vk-gQ2oiMXmhJ%2F-LJnZ0rUXJxZsKWh8KAJ%2Fscreenshot12.png?generation=1534168413299358\&alt=media)

### Fields to Refresh <a href="#fields_to_refresh" id="fields_to_refresh"></a>

Prior to CloudForms 4.6 (ManageIQ *Gaprindashvili*) dynamic service dialog elements could be set to refresh automatically with the **Auto refresh** option. A corresponding option **Auto Refresh other fields when modified** could be defined on other elements that would trigger *all* **Auto refresh** elements in the dialog to update.

The new service dialog functionality has extended this auto-refresh capability to make it much more granular. The **Options** tab for an element now has a **Fields to Refresh** drop-down that allows individually selected dynamic elements to be refreshed (see screenshot [Setting Fields to Refresh](#i13)).

![Setting Fields to Refresh](https://49669005-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGPjFJQMOoGonN-rIX1%2F-LJnZ0-vk-gQ2oiMXmhJ%2F-LJnZ0rWIQneo7IKqwex%2Fscreenshot13.png?generation=1534168411584560\&alt=media)

> **Warning**
>
> Care should be taken that circular references are avoided and that elements are not set to mutually refresh each other.

### Multi-Select Elements

A Dropdown element has an **Options** tab option of **Multiselect** (see screenshot [Defining a Multiselect Element](#i14)).

![Defining a Multiselect Element](https://49669005-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGPjFJQMOoGonN-rIX1%2F-LJnZ0-vk-gQ2oiMXmhJ%2F-LJnZ0rYBnHil8ThfkeS%2Fscreenshot14.png?generation=1534168410997785\&alt=media)

When the dialog is run the user has the option of selecting multiple values from the dropdown list (see screenshot [Selecting Multiple Values from a Dropdown List](#i14)).

![Selecting Multiple Values from a Dropdown List](https://49669005-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGPjFJQMOoGonN-rIX1%2F-LJnZ0-vk-gQ2oiMXmhJ%2F-LJnZ0r_hlpLG8pxhYBv%2Fscreenshot15.png?generation=1534168415794719\&alt=media)

### Element Visibility

Elements can be optionally marked as hidden using the **Visible** slider from the **Options** tab for a static element, or the **Overridable Options** tab for a dynamic element. Hidden elements are not visible when the dialog is initially loaded, however dynamic element methods can toggle the visibility status for an element to unhide them, perhaps based on the input from a previous element.

The following dynamic method sets an element to be conditionaly visible depending on the input from a previous radio button:

```ruby
service_name_required = $evm.root['dialog_service_name_required']
list_values = {
  'required'   => false,
  'protected'  => false,
}
case service_name_required
when 't'
   list_values['visible'] = true
else
   list_values['visible'] = false
end
list_values.each do |key, value|
  $evm.object[key] = value
end
```

### Summary

This chapter has discussed the new service dialog functionality with CloudForms 4.6 (ManageIQ *Gaprindashvili*). Dialogs can be created more easily, and to be more dynamic than ever before.
