How to Use the REST API from VBS Redwood seeded page in field expression
Hi All,
I have a requirement to display a default value in a field. The value is returned from a REST API and stored in a page variable. I need to return this variable inside the field’s value expression function.
I was able to achieve this using an action chain, but I am currently unable to retrieve the value through the field expression function.
Can you please help?
/* eslint-disable dot-notation */define([], () => { 'use strict';
async function getDocumentRecordsDocumentRecordsDFFPerDiemAmount(context) { const { $fields, $and, $co, $variables} = context;
try { // Step 1: Get UserTableId for TRIP_ABOVE_14_DAYS (Column A) const resp1 = await Actions.callRest(context, { endpoint: 'site_hcm_extension:UDT_Table_Names_Trip_Above_14/UDT_Above_14_ID', requestTransformOptions: { filter: { op: '$and', criteria: [ { op: '$co', attribute: 'UserTableName', value: 'TRIP_ABOVE_14_DAYS' }, { op: '$co', attribute: 'UserColumnName', value: 'A' } ] } } });