Custom Domo App (Replicating the SugarForce example)
I am trying to replicate the steps of the SugarForce sample code from Vanilla Javascript tutorial. After my initial setup (sample dataset, domo app cli, app initialization and publish), my domo.get command is giving me a 404 error for the following:
domo.get('/data/v2/leads?limit=10') .then(function(leads){ console.log("leads", leads); });
Any possible troubleshooting suggestions?
Comments
-
In your manifest file you should have an alias defined which is mapped to a specific dataset. You'll want to make sure you're using that alias instead of
leads
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1 -
Thanks for the suggestion, @GrantSmith. I do have the alias 'leads' setup in the manifest as per the instructions.
"datasetsMapping":[
{
"dataSetId": <ID>,
"alias": "leads",
"fields": []
}
],
Although, when I was comparing the code published on that tutorial I can see that Domo.js was missing in my setup. I am assuming that when I loaded the SugarForce template, for reason, It didn't bring the domo.js module. I tried to manually copy-paste the file from the code but that is not working as well.
I have a feeling this domo.get error has something to do with my incorrect domo.js setup. But, I do not know how to correctly set it up instead of just copy pasting the code.
0 -
Try /data/v1/leads instead of /data/v2/leads
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1 -
same error with the v1
0 -
I tried installing domo,js as per instructions here:
And I see that the ryuu.js package was installed but no domo.js still
(updated): I see that Domo.js is now part of the installed package.
0 -
I tried running on my local dev instance to eliminate the permissions issue with the company instance.. but the same error with the local dev instance
0 -
also, I got the same get request error for the second tutorial 'Return Flow'
0 -
Added Embed authorization to the localhost (although, I don't think this should matter), to no avail
0 -
Added token authorization, still no bueno
0 -
@sourabh05 I see two issues:
1.) You have "datasetsMapping", while the code requires "mapping".
2.) You have "DataSetId", while the code requires "datasetId".
Here is an example from some of my existing app that I wrote last week (however this is for a react app; not a vanilla JS. Meaning that there are possibly differences I am not accounting for).Hope this solves your issue^!
** Was this post helpful? Click 💡/💖/👍/😊 below. **
** If it solved your problem. Accept it as a solution! ✔️ **
Or do you need more help? https://calendly.com/matthew-kastner/15-minute-chat
Did I help you out? Feedback is priceless and will help me more than you know.Write a review!0 -
Hi @MattTheGuru - Thanks for your feedback. Those attributes were created by the SugarForce template but in any case, I tried changing those to what you mentioned above and that still does not work.
0 -
Oh wait, @sourabh05 the issue is because you are running it locally and there is no server located at http://localhost:3000/domo/data/v2/leads?limit=10" to accept that request.
Try pushing it up to your actual instance of Domo and running it there with automatically switch from trying to hit "http://localhost:3000" to Domo's local server. Push your code up and it will work.
If you want it to work locally then you need to have the the proxy set up (is this your actual question?)** Was this post helpful? Click 💡/💖/👍/😊 below. **
** If it solved your problem. Accept it as a solution! ✔️ **
Or do you need more help? https://calendly.com/matthew-kastner/15-minute-chat
Did I help you out? Feedback is priceless and will help me more than you know.Write a review!0 -
yes, I want to run it locally (in the dev instance using domo dev CLI command) before I release the app to the Domo instance. I was thinking about setting up a proxy but all the documentation says that proxy is only needed for the AppDB not for the Data APIs.
0 -
@sourabh05 I have always used the proxy when working locally, but you can always "redeploy" to the exact same app in the Domo instance using the "id" in the manifest.
** Was this post helpful? Click 💡/💖/👍/😊 below. **
** If it solved your problem. Accept it as a solution! ✔️ **
Or do you need more help? https://calendly.com/matthew-kastner/15-minute-chat
Did I help you out? Feedback is priceless and will help me more than you know.Write a review!1 -
@MattTheGuru your suggestion worked! It needed a proxy and as soon as I added that I am able to successfully retrieve the object through get method.
So apparently proxy is needed for both AppDB and Data APIs. And I am able to do this in the local dev server. Thank you!!
0 -
how to add a proxy
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 738 Beast Mode
- 56 App Studio
- 40 Variables
- 684 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 35 Predict
- 14 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 123 Manage
- 120 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive