Hopefully someone can point me in the right direction.
Currently the users have a URL that they would navigate to, which downloads the file(excel, csv) to their local machine.
They would then import the data through the application/import widget.
We would like to schedule/automate this process.
Is it possible to save file in object and import data from a file automatically using a download link?
The provider does not have an API that can be used to retrieve the data. (The data is only available within the excel file that is downloaded through the URL)
Thanks
Afternoon Hendry,
If I understand you correctly, you would like Create to navigate to a URL on a scheduled basis that will retrieve a file which then subsequently needs to be imported into Create.
Is the url consistent and the file I presume has the latest data during each fetch?
Are there any credentials needed?
If the file is public without any credentials required this should be feasible but only with a custom event action to perform the curl call on a signal and upload the file to a file object after which a new record event could fire an import action against said file.
Please let me know the answer to the questions above and I’ll do my best to point you in the right direction as far as an event action is concerned if appropriate.
Hi Adam,
Yes, you are correct in what I’m trying to achieve.
The URL is consistent and the file will contain all the latest data.
There are no credentials required at any point.
I appreciate that you can share some steps to make this work.
Thanks
Hi Adam,
I’ve got the import to work on a scheduled basis.
The curl call was the key point to get this working.
From there I could save the response/content to the file object and trigger the import action.
Thanks for your help, much appreciated.
1 Like
Hendry,
10/10 for getting that working!
Would you share a version of the event action here for others to make use of?
Best Wishes
Adam
Below are the steps that I’ve taken to get the import to work.
-
Create Signal that is triggered on a schedule.
-
Create Custom Event Action.
Within the Custom Event Action:
//Perform a cURL request
//Note: Domain needs to be added through the ‘Firewall And Access Profiles’
let response = cs.curl(‘https://www.example.com/ExcelDocument.xls’)
//create new record and get new record id in Document File object
let new_record = cs.save(cs.ref(‘Object_Document_File’), {‘:id’:null});
new_record_id = new_record.records.base.record_id;
//write the response/content to the new record within the Document File object
var write_result = cs.write_file(new_record_id, cs.ref(“FP_Documents_File”), ‘ExcelDocument.xls’,
response[‘response’]);
-
Create Rule that runs the Custom Event Action. (This rule gets triggered by the Signal)
-
Create Rule that runs the Import Data action. (This rule gets triggered when the record gets modified in the Document File object)