How to display data from a client script to an HTML widget and display its value in a text field.

John Clyde Ap_a
Giga Expert

I have a custom with label variable in a record producer that is connected to this widget and I am trying to display data from a value that has been set in the client script. (green box)

find_real_file.png

How to implement it so it will show the value in a text field? 

 

1 ACCEPTED SOLUTION

okay @John Clyde Ap[as ,

i think i got your requirement now .

you are storing total cost in total cost variable .

If yes then do like this

in client controller add this line

c.data.cost=totatCost;

HTML

<div>

<input type="text" value ={{c.data.cost}}>

</div>

try this and let me know

View solution in original post

14 REPLIES 14

You are welcome @John Clyde Ap[as 

Hello @Mohith Devatte ,

 

This is so helpfull but i have a question.

My "Total amount" don't take decimal in count.

 

For exemple, i have 10 computers at 189,50 euros each one.

In total amount, it write 1890 instead of 1895.

 

How can i correct this please?

 

Thanks in advance.

@Bongio Was bit away form community ,so could not reply on time.

 

Try to do parseFloat(totalCost*10);

 

May be this might help

 

If this helped you mark my answer correct or helpful 

Thanks

 

Hi @Mohith Devatte ,

 

I need help on service Portal.

Widget : Like i would like to pass the value from Client script to HTML code.

in  the Below screen short i need get the sys_id(RED colored) from client script to HTML URL (yellow color) dynamically. We tried to give the sys_id statically it worked correctly. Can you please help me to achieve this.

Hi @Mohith Devatte , can you help on this below  requiment:

 i have created widget to  list of equipment and its quantity and added to catalog item using custom data type, i could see all data which are created in widget on portal , however when submitted ritm , i  could not see widget data on sc_task though i haved in flow action created catalog task.i query is how pass widget data into sc_task variables.i have added widget  html code


@Mohith Devatte wrote:

@John Clyde Ap[as can you try this ?

<div>

<input type="text" value ={{c.data.label}}>

</div>

 


 

sc_task form:

anitha0887_0-1715260980870.png

 

anitha0887_1-1715260980866.png

 

widget html:

<div>
<!-- your widget template -->

<div ng-app="myApp" ng-controller="formCtrl">
<form>

<table style="width:100%">

<tr>
<th>AV Equipment</th>

<th>Quantity</th>
</tr>
<tr>
<td class="menu" ng-model="Easel">Easel</td>
<td>
<input class="cell" ng-model="myInput" ng-init="myInput='0'"/>

</td>
</tr>
<tr>
<td class="menu">Flip Chart</td>
<td>
<input class="cell" ng-model="myInput1" ng-init="myInput1='0'"/>

</td>
</tr>
<tr>
<td class="menu">Meeting Support Presence</td>
<td>
<input class="cell" ng-model="myInput2" ng-init="myInput2='0'"/>

</td>
</tr>

<tr>
<td class="menu">Microphone</td>
<td>
<input class="cell" ng-model="myInput3" ng-init="myInput3='0'"/>

</td>
</tr>
<tr>
<td class="menu">Podium</td>
<td>
<input class="cell" ng-model="myInput5" ng-init="myInput5='0'"/>

</td>
</tr>
<tr>
<td class="menu">Slide</td>
<td>
<input class="cell"ng-model="myInput05" ng-init="myInput05='0'"/>

</td>
</tr>

<tr>
<td class="menu">Power Strip</td>
<td>
<input class="cell" ng-model="myInput6" ng-init="myInput6='0'"/>

</td>
</tr>
<tr>
<td class="menu">Extra Chairs</td>
<td>
<input class="cell" ng-model="myInput06" ng-init="myInput06='0'"/>

</td>
</tr>
<tr>
<td class="menu">Stage</td>
<td>
<input class="cell" ng-model="myInput7" ng-init="myInput7='0'"/>

</td>
</tr>
<tr>
<td class="menu">Table</td>
<td>
<input class="cell" ng-model="myInput8" ng-init="myInput8='0'"/>

</td>
</tr>
<tr>
<td class="menu">Owl Videoconferencing</td>
<td>
<input class="cell" ng-model="myInput9" ng-init="myInput9='0'"/>

</td>
</tr>
<tr>
<td class="menu"> Markers for Flipcharts</td>
<td>
<input class="cell" ng-model="myInput10" ng-init="myInput10='0'"/>

</td>
</tr>
<tr>
<td class="menu"> Blue tape for walls</td>
<td>
<input class="cell" ng-model="myInput11" ng-init="myInput11='0'"/>

</td>
</tr>
<tr>
<td class="menu"> Dry erase markers and erasers for dry erase walls</td>
<td>
<input class="cell" ng-model="myInput12" ng-init="myInput12='0'"/>

</td>
</tr>
<tr>
<td class="menu"> Specify which mics we need (lav,tabletop, jawbone)</td>
<td>
<input class="cell" ng-model="myInput13" ng-init="myInput13='0'"/>

</td>
</tr>
</table>