Unable to get Fullname from DatabaseOutput Variable

Hi team,

I am using a function to extract name from Database output stored in variable named “pk_tableOutput”

Please find the function code below:

  return new Promise(resolve => {
          let dbResponse = data.variables.pk_tableOutput;
          ymLib.logger.log(dbResponse,"Sample-DB-Search");
  
          let user_name = dbResponse.records[0].fullname;
          ymLib.logger.log(user_name,"Sample-name");
          resolve(user_name);
      });    

When I check back into the logs “data” : “records” is not coming.
Please help me.

Can you share a screenshot of the schema with the data to get an understanding of what we’re retrieving here

Database is below

I am searching in Database

Now using function to extract name from table output

storing in variable

want to use the variable here

@pawan_kumar

dbResponse is an array with an object inside
you can avoid using records and just move into the first item within the array

Please try
let user_name = dbResponse[0].fullname;

1 Like