Highlighted
Acclaimed Contributor.
Acclaimed Contributor.
252 views

Get Data from XML (user selection from SRC)

Hello.

How can i get in script value in "option label" wich relate to "select" (value that user selected)

For example:

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<form><text readonly="false" multiline="false" label="Please select path" id="path">C:/Temp</text>
<select readonly="false" style="radio" label="Access right" id="ReadWrite">2<option label="Only read">1</option><option label="Read-Write">2</option></select>

Red font - the value that the user selected.

 

In that case user select "2", how can i get data that corresponding to this choice - "Read-Write"

------------

as this section: 

<option label="Only read">1</option><option label="Read-Write">2</option>

describes the xml versions of the user's choice.

0 Likes
2 Replies
Highlighted
Honored Contributor.
Honored Contributor.

Re: Get Data from XML (user selection from SRC)

I have an SRC field name: NameofApplication which I needed to be extracted from user selection of SRC to be use in the related Change record field:  affected.item

1. I defined the expression in Catalog connector

Service Catalog> Administration> Tailoring >Catalog Connectors> Open a Change

This uses the script name: xmlFill.getValue

if (filename($L.file)="cm3r" and svcCatalogId in $L.cartItem="2787") then (affected.item in $L.file=jscall("xmlFill.getValue", svc.options in $L.file, "NameofApplication"))

2. Once a ticket is raised from SRC Catalog and will have auto-related Change record, the field is auto-filled with the value selected from User Selection n SRC

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Get Data from XML (user selection from SRC)

We use SRC on request.

And now on FORM (OCMQ or OCML) there is an element - 'dynamic form' with input 'svc.options'

This form display the user selection as it user saw it in catalog

SRC_svc_001.jpg

And when you setup it in user selection it looks like:

SRC_svc_002.jpg

How can i get this Label from XML and not a value (wich marked on second csreen) bcuz xml contains VALUE selected by user (not a label)?

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.