Is there a possibility to read excel from smart contract? If yes how? Do I need some relay or something.


2 Answers 2


You can't read data from an external source inside a Solidity contract, but depending on your needs you could do one of the following.

1- Utilize a service such a Oraclize that allows your contract to obtain data from an external source. You could build an API and have your contract query it through Oraclize.

2- You could process the excel file client-side, say in JavaScript, and send a transaction to your contract with the processed data as input.


Since you need to deploy the smart contract and let it access the sheet, I think you may first need to keep it in a remotely accessible place.

So basically you can store the spreadsheet and open an api end point access it. (This can be done by many server side implementing languages/ Google sheet api also would be ideal and easy - at least for testing ).

Now the problems is reduced to smart contract access an api. You may use a service like Oraclize for that. As oraclize says,

Smart contracts live like in a walled garden, they cannot fetch external data on their own. Oraclize is here to help. Orcalize act as a data carrier, a reliable connection between Web APIs and your Dapp.

Refer this and this questions.

Question here would give a good idea on how this works.


Not the answer you're looking for? Browse other questions tagged or ask your own question.