-
Notifications
You must be signed in to change notification settings - Fork 189
Open
Labels
Description
Can some explain how to create an async/await function in ijavascript so I can get access to the actual data?
const makeRequest = async (config) => {
const req = await axios.request(config);
return req.data
}
data = makeRequest(config)
printing data in a cell returns
Promise {
{
objectIdFieldName: 'OBJECTID',
uniqueIdField: { name: 'OBJECTID', isSystemMaintained: true },
globalIdFieldName: '',
geometryType: 'esriGeometryPoint',
spatialReference: { wkid: 4269, latestWkid: 4269 },
fields: [
[Object], [Object], [Object],
[Object], [Object], [Object],
[Object], [Object], [Object],
[Object], [Object], [Object],
[Object], [Object], [Object],
[Object], [Object], [Object],
[Object], [Object], [Object]
],
So I can tell the request resolved, but then typing
data['objectIdFieldName']
returns nothing.
How do I access the actual data? I've tried JSON.parse, but that doesn't work either.