cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

How to assign Query results to Datashape

dsenniappan
7-Bedrock

How to assign Query results to Datashape

Hi ,

I have a query result like below,

Column1

Row1

Row2

Row3

I have a Datashape with 3 fields - Field1, Field2 , Field3.

How to assign the Row1 to Field1 ?

Thanks in advance for your answer.

ACCEPTED SOLUTION

Accepted Solutions
vr-6
12-Amethyst
(To:dsenniappan)

Hi,

Let me assume you are storing query data to variable "info" and your datashape "datashape"

Create a new Object and add values to fields.

var newEntry = new Object();

newEntry.Field1= info.rows[0].Column1

newEntry.Field2= info.rows[1].Column1

newEntry.Field3= info.rows[2].Column1

datashape.AddRow(newEntry); // Add Object to DataShape

View solution in original post

1 REPLY 1
vr-6
12-Amethyst
(To:dsenniappan)

Hi,

Let me assume you are storing query data to variable "info" and your datashape "datashape"

Create a new Object and add values to fields.

var newEntry = new Object();

newEntry.Field1= info.rows[0].Column1

newEntry.Field2= info.rows[1].Column1

newEntry.Field3= info.rows[2].Column1

datashape.AddRow(newEntry); // Add Object to DataShape

Announcements


Top Tags