I'm trying to use a Google Sheet as my data source or alternatively update my entity with data from this Google Sheet. I seem to have the authentication working right from the Google Authentication Demo on Forge but I'm not sure what nodes I need to use to actually do something with this data rather than just display it. I am also very new to Outsystems.
Hi @Bradley Oxley,
We did this using the Google Sheets API. See the below steps as a reference. As you told in your intro that you have the authentication part working I am not going to explain how to do that.
1. Consume a REST API (https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values/{range})
2. Create a server action to retrieve the data
Hope this helps you a bit.
Best,
Bart
Thank you for this, however what are the steps actually move this data into the database please? I see nodes like JSON deserialise but it doesn't work
I think there are several ways to do this.
As you can see in the screenshot below we retrieve the spreadsheet data and loop over the result of the server action. Then we append the data to a list. Instead of appending it to a list you could insert it into the db.
Does this make any sense?
Thank you, this is, is there a way I can integrate what I have with the Google Authentication Demo as I dont understand how to set up the REST API thing? Thank you
I think Shriyash mentioned the steps on how you could try that. I do not have expertise on those forge components.
Okay thank you very much for your help, I will wait for his reply
Hello @Bradley Oxley, This might help you to integrate a Google Sheet with your OutSystems application and either use it as a data source or update an entity with data from the sheet, you can follow these steps:
Set up Google Sheets API: -Go to the Google Developers Console (https://console.developers.google.com/).(https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/get)-Create a new project or select an existing one.-Enable the Google Sheets API for your project. -Create credentials (OAuth client ID) for your project to authenticate requests to the API. -Download the credentials file (JSON format) containing client ID, client secret, etc. -Use the Google Authentication Forge component to enable authentication with Google services in your OutSystems application. -Follow the documentation provided by the Forge component to set up authentication using the credentials
Use the Google Sheets Connector Forge component to interact with Google Sheets from your OutSystems application. Install the component into your environment and configure it with the necessary authentication credentials. Use the provided actions in the Forge component to read data from the Google Sheet, such as GetSheetValues.
After retrieving data from the Google Sheet, you can iterate over the rows and update your entity using entity actions. Cheers,Shriyash Dixit
Thank you for your reply, could you perhaps show the nodes needed to iterate over the rows and update, as I'm only starting to use OutSystems in the last couple of weeks and i'm struggling to understand the logic side for a lot of things