REQUESTHTTPX syntax for sending a csv file or Export block descriptor

Hi Team,

We are building a solution using eWON and AVEVA Insight.
I have made some BASIC script to generate a csv file with comma as delimiter and formatted headers according to AVEVA Insight.

But the output csv file is generated with the quotes (" ") which is not supported by AVEVA Insight.
Is there a way to eliminate them before sending it to Insight.

And also do you have any example for REQUESTHTTPX syntax for sending a csv file or EDB
for example REQUESTHTTPX url,POST,header,"",csv file

Your help is greatly appreciated!
Looking forward to hearing from you and please let me know if you need more information on this.

Output file has data like below:
“DateTime,tagvalue”
"2020-02-04T12:08:27Z,0
"
"2020-02-04T12:08:28Z,0
"
"2020-02-04T12:08:30Z,0
"
"2020-02-04T12:08:32Z,0
"
"2020-02-04T12:08:34Z,0
"
"2020-02-04T12:08:36Z,0
"
"2020-02-04T12:08:38Z,0
"
"2020-02-04T12:08:40Z,0
"
"2020-02-04T12:08:42Z,0
"
"2020-02-04T12:08:44Z,0
"
"2020-02-04T12:08:46Z,0
"

Thanks and regards,
Vinodkumar bhovi

Hi @vinod_bhovi

This is something that can be done through the BASIC IDE by creating a custom .csv file. I have an example of doing something like that here:

custom_historical_log_example.txt (2.4 KB)

If you’d like us to develope the code/csv file, this is something that we could offer as a paid service.

I’ll need to check on the request/responsehttpx

Hi @Tim_hms,

Thanks for the quick response.
I have already created a BASIC script code for it and attached the output in my previous message.

My query is regarding how to send it via REQUESTHTTPX syntax and also generated output csv file has quotes (" ") on the extreme ends as they are strings, how to eliminate them as our application doesn’t support those quotes.

Thanks for your help in advance.

Thanks and regards,
Vinodkumar bhovi

Hi Team,

Any update on my query ?

Thanks and regards,
Vinodkumar bhovi

If you want to be able to remove those quotes, you’ll need to make a custom csv file like the example shown above.

As for how to send the requesthttpx you should be able to do this by including the csv file in the EBD

Hi @Tim_hms,

Thanks, I was able to generate custom csv file.
But stuck with REQUESTHTTPX syntax still. I am using the below code to send data to wonderware online with bearer token.

Key1$ = “Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6ImZmZDlhZDM1LTFjOTMtNGVhZi05Yzg3LWNkNWI2MjUwODI0MSJ9.”
Key2$ = “eyJEYXRhU291cmNlSWQiOiI1NzQ1NTg4MC0zZmUzLTRlYTAtYTg5ZS03ZDBjMTJkY2NjNmIiLCJ0eXBlIjoic2VydmljZSIsInZlcnNp”
Key3$ = “b24iOiIxLjAiLCJ0ZW5hbnRpZCI6IjRiZGQyNDQxLWI1NmItNGVmMi1iN2Y1LTE3NWNjNGYzOTRlZiIsInNpaWQiOiI5ZjA1NjNlYy1hY”
Key4$ = “zc3LTQ4ZTItYjQ5ZS0wYWNlZjRiNDBjOGYiLCJqdGkiOiI0YTRmZWVhNy03MmZlLTRhMWEtYjM5Yy1mZTAwZWRhYTU0MWUiLCJpc3MiOi”
Key5$ = “Jwcm9vZm9maWRlbnRpdHlzZXJ2aWNlIn0.U4MgxaioahZqYvDQFaOqpfLJe-DrLv4XchYUS9Q9jsXCnW9NWQ3IYp-n4tPcwM6GZklgzoFg”
Key6$ = “4GZ_Mg-7-hC-tLEHUwqf8ZL2NKxtI4P00xhJGoj1s9oPwiZhwnwU_zETHFipz8FEYO6dSDJQa1ixRMdczMiyUbqFLKTh2sziD-N0gaWG8R”
Key7$ = “2Q25Nbc_MsSoHMg4or3T8VS-VC0a6p0oKtoFbDEzHlD-GrJVav3VASE2zDyKlvtUuphvOKYTxrLHPp6TFEs0C0r4C9gDMxgUQwscGAy-vOkGEvujq1S1GRGGgbMmoFVny_W0orqY6gidQoVdoUykbmRnRcPOHF7tPTNw”

myKey$ = key1$+key2$+key3$+key4$+key5$+key6$+key7$
Auth$ = "Authorization=" + myKey$
A$ = TIME$
$Inputdata$ = A$
$NewDate$ = $Inputdata$(7 To 10) + "-" + $Inputdata$(4 To 5) + "-" + $Inputdata$(1 To 2) + "T" + $Inputdata$(12 To 19) + "Z"
$URL$ = "https://online.wonderware.eu/apis/upload/datasource"
$header$ = "Content-Type=application/json"                     
$header$ = $header$ + "&"+Auth$

REQUESTHTTPX $url$, “POST”, $header$,"","[$dtUF$uf/usr/fileToSend24.csv]"

where fileToSend24.csv data is below sample one:
DateTime,tagvalue
2020-02-13T10:41:41Z,0

2020-02-13T10:41:42Z,0

2020-02-13T10:41:44Z,0

2020-02-13T10:41:46Z,0

2020-02-13T10:41:48Z,0

2020-02-13T10:41:50Z,0

2020-02-13T10:41:52Z,0

Can you tell me where I am doing mistake.
Looking forward for your answer.

Thanks and regards,
Vinodkumar bhovi

Could you send us a backup.tar file with the support files included so we can try to see the errors that are appearing in the error logs?

Hi @Tim_hms

Attached the requested files.

Thanks and regards,

Hi Vinod,

I’m not sure why but it’s looking like the file you sent me might be corrupted. I’m not able to open it. Could you grab another backup.tar file with support files included from eBuddy for me?

Hi @Tim_hms,

Please find the attached files.
backup.tar (3.4 MB) fileToSend23 (1).txt (225 Bytes)

Hi @vinod_bhovi

I’m not sure what the issue is, but it seems like I haven’t been able to take a look at these backups. Are you using the most recent version of eBuddy?