values.js
values.js
is configuration of JavaScript logic when datatype is executed.
With predefined variables, user can create their own logic for datatype.
It is optional, it needs to be configured if there is a need to execute service api to get the data.
Example values.js
try {
const response = await $.axios({
method: "get",
url: `https://gmail.googleapis.com/gmail/v1/users/me/labels`,
headers: {
"Authorization": `Bearer ${service.token}`,
"Content-Type": "application/json"
}
})
const dataList = response.data.labels
var result = []
dataList.forEach(data => {
result.push({
'value': data.id,
'label': data.name
})
});
return result
} catch (error) {
throw error
}
Helpful?