How can I create a CSV file

584 views
Skip to first unread message

emon...@lanogalera.biz

unread,
Aug 9, 2017, 8:34:16 PM8/9/17
to Fujitsu RunMyProcess Developer Community
How can I create a csv file with the data from the web interface?

Gunjan Rajgure

unread,
Aug 12, 2017, 2:16:13 AM8/12/17
to Fujitsu RunMyProcess Developer Community, Edgar Montoya
Hello Sir,

You need to write javascript code to create csv file. There is code available in javascript. Just need to get data from Web Interface into array and using some javascript code you can create a csv file with that data.

Hope this will helps you. Please don't hesitate to contact us for more query.


Thanks & Regards,
Gunjan Rajgure
Fujitsu - RunMyProcess Support

On Thu, Aug 10, 2017 at 6:04 AM, <emon...@lanogalera.biz> wrote:
How can I create a csv file with the data from the web interface?

--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/e1af327f-705f-4953-870b-b31c5b75a9bc%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.

Gunjan Rajgure

unread,
Aug 14, 2017, 2:18:31 AM8/14/17
to Fujitsu RunMyProcess Developer Community, Edgar Montoya
Hello Sir,

Could you tried JavaScript code to create csv file? Please let us know if you are facing any issue.

 
Don't hesitate to contact us for further query.


Thanks & Regards,
Gunjan Rajgure
Fujitsu - RunMyProcess Support

emon...@lanogalera.biz

unread,
Aug 15, 2017, 2:04:16 PM8/15/17
to Fujitsu RunMyProcess Developer Community, emon...@lanogalera.biz
Helle Gunjan

I'm tried this javascript code, the data I want to wrtie in my csv was in array widget named TratoArray.

function JSON2CSV(objArray) {
var array = typeof objArray != 'object' ? JSON.parse(objArray) : objArray;
var str = '';
var line = '';
var head = array[0];
for (var index in array[0]) {
line += index + ',';
}
line = line.slice(0, -1);
str += line + '\r\n';
for (var i = 0; i < array.length; i++) {
var line = '';
for (var index in array[i]) {
line += array[i][index] + ',';
}

line = line.slice(0, -1);
str += line + '\r\n';
}
return str;
}
var array=RMPApplication.get("TratoArray");
alert(JSON2CSV(array));

Thanks



On Monday, August 14, 2017 at 12:18:31 AM UTC-6, gunjan.rajgure wrote:
> Hello Sir,
>
>
> Could you tried JavaScript code to create csv file? Please let us know if you are facing any issue.
>
>
>  
> Don't hesitate to contact us for further query.
>
>
>
>
> Thanks & Regards,
> Gunjan Rajgure
> Fujitsu - RunMyProcess Support
>
>
> On Sat, Aug 12, 2017 at 11:46 AM, Gunjan Rajgure <gunjan....@runmyprocess.com> wrote:
>
> Hello Sir,
>
>
> You need to write javascript code to create csv file. There is code available in javascript. Just need to get data from Web Interface into array and using some javascript code you can create a csv file with that data.
>
>
> Hope this will helps you. Please don't hesitate to contact us for more query.
>
>
>
>
> Thanks & Regards,
> Gunjan Rajgure
> Fujitsu - RunMyProcess Support
>
>
>
>
> On Thu, Aug 10, 2017 at 6:04 AM, <emon...@lanogalera.biz> wrote:
> How can I create a csv file with the data from the web interface?
>
>
>
> --
>
> Fujitsu - RunMyProcess
>
> ---
>
> You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.

Gunjan Rajgure

unread,
Aug 19, 2017, 1:31:18 AM8/19/17
to Fujitsu RunMyProcess Developer Community, Edgar Montoya
Hello Sir,

You can try out following code to generate csv data.

// Here is the Code.

var var1 = RMPApplication.get("var1");
var var2 = RMPApplication.get("var2");    // Get your web interface data.
var var3 = RMPApplication.get("var3");

var data = [[var1,var2,var3,...]];    // Put your Web Interface data in array

 
function download_csv_file() {
    var csv = 'var1,var2,var3\n';
    data.forEach(function(row) {
            csv += row.join(',');
            csv += "\n";
    });
 
    console.log(csv);   // You can check csv data on browser console.
    var csv_data = document.createElement('a');
    csv_data.href = 'data:text/csv;charset=utf-8,' + encodeURI(csv);
    csv_data.target = '_blank';
    csv_data.download = 'csv_file.csv';   // Name of the file which is download in csv format (you can define the name)
    csv_data.click();
}
download_csv_file();   // Call this function on button click of Web Interface.


Hope this will helps you. You can check your CSV data on browser console.


Please feel free to contact us for further query.


Thanks & Regards,
Gunjan Rajgure
Fujitsu - RunMyProcess Support

To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.

To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.

Dipen Raval

unread,
Aug 21, 2017, 8:48:39 AM8/21/17
to Fujitsu RunMyProcess Developer Community, Edgar Montoya
Hi Sir,

Good Day.

Could you please confirm that issue has been clarified?
Please don't hesitate to contact us for any further query.


Thanks & Regards,
Dipen Raval
Fujitsu RunMyProcess Support

Dipen Raval

unread,
Aug 22, 2017, 5:26:50 PM8/22/17
to Fujitsu RunMyProcess Developer Community, Edgar Montoya
Hi Sir,

Awaiting for your response.


Thanks & Regards,
Dipen Raval
Fujitsu RunMyProcess Support
On Mon, Aug 21, 2017 at 6:18 PM, Dipen Raval <dra...@runmyprocess.com> wrote:
Hi Sir,

Good Day.

Could you please confirm that issue has been clarified?
Please don't hesitate to contact us for any further query.


Thanks & Regards,
Dipen Raval
Fujitsu RunMyProcess Support

emon...@lanogalera.biz

unread,
Aug 24, 2017, 2:32:54 PM8/24/17
to Fujitsu RunMyProcess Developer Community, emon...@lanogalera.biz
On Tuesday, August 22, 2017 at 3:26:50 PM UTC-6, draval wrote:
> Hi Sir,
>
> Awaiting for your response.
>
> Thanks & Regards,
> Dipen Raval
> Fujitsu RunMyProcess Support
>
> Sorry for the late!

I have tried but its doesn't work, its fail in the line
> var data = [[var1,var2,var3]];
> To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/1c7213c9-5dc1-4c82-91e3-a4b5d822bace%40runmyprocess.com.
>
>
>
> For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.
>
>
>
>
>
>
>
> --
>
> Fujitsu - RunMyProcess
>
> ---
>
> You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
>
> To post to this group, send email to suppor...@runmyprocess.com.
>
> Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.
>

Prachi Chandak

unread,
Aug 24, 2017, 4:33:32 PM8/24/17
to Fujitsu RunMyProcess Developer Community, Edgar Montoya
Hi Sir,

I would suggest you to share your code as well as WI configurations of widget for which you want in there value in CSV file.
Please feel free to contact us for any other help.

Thanks & Regards,
Prachi Chandak
Fujitsu RunMyProcess Support

To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.

To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.

Gunjan Rajgure

unread,
Aug 25, 2017, 3:17:01 AM8/25/17
to Fujitsu RunMyProcess Developer Community, Edgar Montoya
Hello Sir,

I think you have confusion between JS variables and the variables used in "RMPAppliction.get", please try out following code to generate csv data.
Get your Web Interface data into the JavaScript variables and add that data into the array named as "data". I used here var1, var2...... and value1, value2...... as example purpose.

// Here is the Code.

var var1 = RMPApplication.get("value1");
var var2 = RMPApplication.get("value2");    // Get your web interface data. 
var var3 = RMPApplication.get("value3");

var data = [[var1,var2,var3,...]];    // Put your Web Interface data in array

 
function download_csv_file() {
    var csv = 'var1,var2,var3\n';
    data.forEach(function(row) {
            csv += row.join(',');
            csv += "\n";
    });
 
    console.log(csv);   // You can check csv data on browser console.
    var csv_data = document.createElement('a');
    csv_data.href = 'data:text/csv;charset=utf-8,' + encodeURI(csv);
    csv_data.target = '_blank';
    csv_data.download = 'csv_file.csv';   // Name of the file which is download in csv format (you can define the name)
    csv_data.click();
}
download_csv_file();   // Call this function on button click of Web Interface.


Hope this will helps you. You can check your CSV data on browser console. Please confirm csv data on browser console by pressing F12.


Please feel free to contact us for any further query.


Thanks & Regards,
Gunjan Rajgure,
Fujitsu - RunMyProcess Support


Abhilash Sambhare

unread,
Aug 26, 2017, 10:10:14 PM8/26/17
to Fujitsu RunMyProcess Developer Community, Edgar Montoya
Hello Sir,

Have you implemented the solution provided in the earlier post.Please don't hesitate to contact us.

Thanks & Regards,
Abhilash Sambhare
Fujitsu RunMyProcess Support

emon...@lanogalera.biz

unread,
Aug 28, 2017, 11:49:04 AM8/28/17
to Fujitsu RunMyProcess Developer Community, emon...@lanogalera.biz
On Wednesday, August 9, 2017 at 6:34:16 PM UTC-6, emon...@lanogalera.biz wrote:
> How can I create a csv file with the data from the web interface?
Hi Gunjan Rajgure

Im tried this code on the console browser line by line but its fail on the last line (var data = [[var1,var2,var3]];) #N/A
var var1=RMPApplication.get("productor");
alert(var1);
var var2=RMPApplication.get("procedencia");
alert(var2);
var var3=RMPApplication.get("calidad");
alert(var3);
var data = [[var1,var2,var3]];

Gunjan Rajgure

unread,
Sep 2, 2017, 6:04:02 AM9/2/17
to Fujitsu RunMyProcess Developer Community, Edgar Montoya
Hello Sir,

That line means you are adding your Web Interface values into the array and using that array you need to perform iterations on array to create comma separate value. Can you please share screen shot of error you are getting, that will be helpful for better understanding. 

Please feel free to contact us for any further query.


Thanks & Regards,
Gunjan Rajgure
Fujitsu - RunMyProcess Support

--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.

Dipen Raval

unread,
Sep 4, 2017, 7:43:34 AM9/4/17
to Fujitsu RunMyProcess Developer Community, Edgar Montoya
Hi Sir,

Awaiting for your response.

Thanks & Regards,
Dipen Raval
Fujitsu RunMyProcess Support

emon...@lanogalera.biz

unread,
Sep 4, 2017, 3:36:45 PM9/4/17
to Fujitsu RunMyProcess Developer Community, emon...@lanogalera.biz
On Wednesday, August 9, 2017 at 6:34:16 PM UTC-6, emon...@lanogalera.biz wrote:
> How can I create a csv file with the data from the web interface?

I attach the screenshot

Cordially
Edgar Montoya

VarDataerror.PNG

Gunjan Rajgure

unread,
Sep 4, 2017, 4:28:14 PM9/4/17
to Fujitsu RunMyProcess Developer Community, Edgar Montoya
Hello Edgar,

There is syntax error in array declaration, apology for that. You can use same code as

// Same code as above.
var var1 = RMPApplication.get("value1");
var var2 = RMPApplication.get("value2");    // Get your web interface data. 
var var3 = RMPApplication.get("value3");

var data = [
                   [var1,var2,var3,...]
                 ];    // Put your Web Interface data in array. Here is the change only.

 
function download_csv_file() {
    var csv = 'var1,var2,var3\n';
    data.forEach(function(row) {
            csv += row.join(',');
            csv += "\n";
    });
 
    console.log(csv);   // You can check csv data on browser console.
    var csv_data = document.createElement('a');
    csv_data.href = 'data:text/csv;charset=utf-8,' + encodeURI(csv);
    csv_data.target = '_blank';
    csv_data.download = 'csv_file.csv';   // Name of the file which is download in csv format (you can define the name)
    csv_data.click();
}
download_csv_file();   // Call this function on button click of Web Interface.


Just declare array as -
 Instead of var arr=[[a,b,c,d]]; use 
var arr=[
               [a,b,c,d]
             ];

Note: Don't forget to see output on browser console by pressing F12.

Please feel free to contact us for any further query.


Thanks & Regards,
Gunjan Rajgure
Fujitsu - RunMyProcess Support
--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.

Dipen Raval

unread,
Sep 6, 2017, 4:49:30 PM9/6/17
to Fujitsu RunMyProcess Developer Community, Edgar Montoya
Hi Sir,

Good Day.

Could you please confirm that issue has been clarified?
Please don't hesitate to contact us for any further query.


Thanks & Regards,
Dipen Raval
Fujitsu RunMyProcess Support

Prachi Chandak

unread,
Sep 8, 2017, 3:42:55 PM9/8/17
to Fujitsu RunMyProcess Developer Community, Edgar Montoya
Hello Edgar,

Have to able to create CSV  file or you are still facing any issues.
Please confirm if the issue has been clarified.

Thank you for contacting.

Thanks & Regards,
Prachi Chandak
Fujitsu RunMyProcess Support

On Thu, Sep 7, 2017 at 2:19 AM, Dipen Raval <dra...@runmyprocess.com> wrote:
Hi Sir,

Good Day.

Could you please confirm that issue has been clarified?
Please don't hesitate to contact us for any further query.


Thanks & Regards,
Dipen Raval
Fujitsu RunMyProcess Support

Dipen Raval

unread,
Sep 11, 2017, 7:48:37 AM9/11/17
to Fujitsu RunMyProcess Developer Community, Edgar Montoya
Hi Edgar,


Awaiting for your response.
Thanks & Regards,
Dipen Raval
Fujitsu RunMyProcess Support

emon...@lanogalera.biz

unread,
Sep 26, 2017, 12:31:58 PM9/26/17
to Fujitsu RunMyProcess Developer Community, emon...@lanogalera.biz
Sorry for the late

I create the csv with this code:
function JSON2CSV(objArray) {
var array = typeof objArray != 'object' ? JSON.parse(objArray) : objArray;
var str = '';
var line = '';
var head = array[0];
for (var index in array[0]) {
line += index + ',';
}
line = line.slice(0, -1);
str += line + '\r\n';
for (var i = 0; i < array.length; i++) {
var line = '';
for (var index in array[i]) {
line += array[i][index] + ',';
}

line = line.slice(0, -1);
str += line + '\r\n';
}
return str;
}
var prod=RMPApplication.get("productor");
var proc=RMPApplication.get("procedencia");
var vol=RMPApplication.get("volumen");
var pp=RMPApplication.get("precPunto");
var cal=RMPApplication.get("calidad");
var rc=RMPApplication.get("repCompra");
var com=RMPApplication.get("comision");
var cp=RMPApplication.get("condPago");
var tt= RMPApplication.get("tipTrato");
var array=[{"Productor":prod,"Procedencia":proc,"Calidad":cal,"CondPago":cp}];

alert (JSON2CSV(array));
But i how can I sent this code by email or ftp as a file?

On Monday, September 11, 2017 at 5:48:37 AM UTC-6, draval wrote:
> Hi Edgar,
>
> Awaiting for your response.
>
>
> To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
>
> To post to this group, send email to suppor...@runmyprocess.com.
>
> Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.
>
> To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/0353d182-14e3-4db0-85ec-b99638097410%40runmyprocess.com.
>
>
>
> For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.
>
>
>
>
>
>
>
>
>
> --
>
> Fujitsu - RunMyProcess
>
> ---
>
> You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
>
> To post to this group, send email to suppor...@runmyprocess.com.
>
> Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.
>
> To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/CA%2B3gzEj7di2siOBbB4jtWJAUPdinZ-%3D6CsgZ0FBsZE7HBj4tRA%40mail.gmail.com.
>
>
>
> For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.
>
>
>
>
>
>
>
> --
>
> Fujitsu - RunMyProcess
>
> ---
>
> You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
>
> To post to this group, send email to suppor...@runmyprocess.com.
>
> Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.
>
> To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/CALU-SgpgpJmfFUsi-SCoACpBqrWzOiM36NfDgFLeiZr1%2BpJuXA%40mail.gmail.com.
>
>
>
> For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.
>
>
>
>
>
>
>
> --
>
> Fujitsu - RunMyProcess
>
> ---
>
> You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.

Ankita Shrinath

unread,
Oct 23, 2017, 8:54:41 AM10/23/17
to Fujitsu RunMyProcess Developer Community, emon...@lanogalera.biz

Hi Edgar,

Good Day.


All our apology for delay in response.


To send the csv file that you have downloaded, please follow the below steps:-


1.Add ‘File upload’ widget to web interface. Give the variable name to the widget (eg. File_upload).


2.Now create a process that sends the csv file (uploaded using ‘File upload’ widget) via email.


3.When you select the activity, in the Functional tab select Type as ‘Email/Notification’. In the ‘Send an email/a notification’ tab, enter the required details, check ‘Notify via email’ checkbox. Select Provider as ‘Default mail server’. In the Attach file option, click on ‘Open an editing window’ and write the following script code:


<#assign file_list=[]>

<#list file as x>

<#assign file_list = file_list +[x.id]>

<#list>

${file_list}


Here “file” is ‘File upload’ widget’s variable name.And save the process.


4.Now in web interface add a button. Select ‘Action’ as Start process. Then click on choose process and select the process that you have created (to send email).


Hope this steps will help you to send file via email.

Please feel free to contact us for any further information.



Thanks & regards,

Ankita Shrinath

Fujitsu RunMyProcess Support

Dipen Raval

unread,
Oct 24, 2017, 4:07:27 PM10/24/17
to Fujitsu RunMyProcess Developer Community, Edgar Montoya
Hi Edgar,

Good Day.

Could you please confirm that issue has been clarified?
Please don't hesitate to contact us for any further query.

Thanks & Regards,
Dipen Raval
Fujitsu - RunMyProcess Support

--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.

To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.

emon...@lanogalera.biz

unread,
Oct 25, 2017, 5:58:58 PM10/25/17
to Fujitsu RunMyProcess Developer Community, emon...@lanogalera.biz
On Wednesday, August 9, 2017 at 6:34:16 PM UTC-6, emon...@lanogalera.biz wrote:
> How can I create a csv file with the data from the web interface?

Thanks is clrarified, but I use jsontocsv in the process

Thank you again for the support

Reply all
Reply to author
Forward
0 new messages