How to store data from spreadsheet to a field?

Confluence User - 05 Oct, 2020


For example, in spreadsheet I choose plants as ABC, DEF, GHI then the pic name and email will auto filled.
And I want Plant(s) and PIC Email fields to also get the value from spreadsheet. 


Thank you!

spreadsheet;beanshell

3


06 Oct, 2020
confluenceUser
confluenceUser

This can be done via Javascript in a custom HTML form element.

Do try my sample code snippet below and replace the necessary parameter values:

var values = FormUtil.getGridCellValues("spreadsheetId.columnId");
FormUtil.getField("targetFormFieldId").val(values[0]);
06 Oct, 2020
confluenceUser
confluenceUser

I change my spreadsheet to grid and try the code but it did not return the grid data to field Plant(s) and PIC as an array. 

Here what I did;



Thank you!



06 Oct, 2020
confluenceUser
confluenceUser

As mentioned, my script is Javascript, not Java (Bean Shell). Place code in custom html form element.

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print