ConfiForm rendering an array from Jira
Asked by Jim Rogers:

Hey, I am looking for guidance on rendering the Labels array returned in a Jira payload on ConfiForms. I have tried referencing the array via a Formula field type and the expression as: "\[myfield.fields.labels.transform(value).asList\]" . Also referencing without the virtual asList as: "\[myfield.fields.labels.value\]".  

What I get is: **\["\["label1","label2","label3","label4"\]"\] could not be calculated, Unknown operator or function: label4**

All I am trying to is display the list of values on a Form View macro. I am successfully displaying other values (that are not arrays) on the form. I also know the data is coming in as the correct values are represented in the text of the error (as above).


Answers:
author: Alex Medved _ConfiForms_
body: Hi

Welcome to this community [@Jim Rogers](/t5/user/viewprofilepage/user-id/4980848)

What are you trying to calculate with your labels? I mean, why do you use a formula field?

Why not a simple text field? Or a dynamic multi-label field?

Alex

comments: author: Jim Rogers
body: Alex,

I am sure I am over complicating it. I was using the formula to be able to get the value into the field.   

My Jira JSON response is:

"labels": \[  
"Label1",  
"Label2",  
"Label3",  
"Label4"  
\],

All I want to do is display these values on the Form View   
![Confiforms form view.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/204800iFF5727839C8748B0/image-size/large?v=v2&px=999 "Confiforms form view.jpg")

I have a number of other fields returned from JIRA I need to display on the form. One is working with the formula (Not an array field). So the simple text field is certainly a more appropriate type. I just don't know how to get the value in it.

Thank you!!!! Jim


author: Alex Medved _ConfiForms_
body: You can access Jira fields directly in your views, via Jira field

<https://wiki.vertuna.com/display/CONFIFORMS/Accessing+Jira+issue+fields+directly+from+ConfiForms+using+Jira+issue+field>

I dont quite understand what is this "myfield.fields.labels"... What is myfield? is it a Jira field you have in ConfiForms?

Alex


author: Jim Rogers
body: Alex,

Changed the screen prints to help. JiraID is my field in the table that contains the field of type Jira Issue. All of that is working perfectly.

I have actually used the information on the above page and they work fine for the table view macro. I am trying to show these on a Form View and with the values in the label array.

![Confiforms form view 2.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/204817i5A3A4554B0C99C2E/image-size/large?v=v2&px=999 "Confiforms form view 2.jpg")

What I get is the Jira object description as if I wasn't referencing a sub field in the JSON structure.

![Confiforms form view 3.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/204818i2507EA3EA7DFDEC5/image-size/large?v=v2&px=999 "Confiforms form view 3.jpg")

Finally, if I reference JiraID.fields.labels on the table view, it renders as \["Label1","Label2","Label3","Label4"\]. So not great, but it works.

Thank you! Jim


author: Alex Medved _ConfiForms_
body: But what do you want to get rendered? The values can be transformed, I am pretty confident

What format do you want to see?


author: Alex Medved _ConfiForms_
body: Little demo of what you can do with multi label field, for example...

<http://recordit.co/YXWwUu0fcn>


author: Jim Rogers
body: Alex,

I got it to work with your guidance and video!!! Now I need to read more on the new portions you taught me (and eventually others will benefit).

I really appreciate you helping here.

Jim


author: Alex Medved _ConfiForms_
body: You are welcome.

PS, you can accept the answer in this case ;-)


Tags: cloud

confiforms

confluence-cloud