Why from FORMULA, when I have a URL variable from API REST, it does not take the image and I get an error?

Hello everyone: I am trying to link an image from API REST, but I get an error, but if I take the URL and paste it directly as in the example, it works.

It should be clarified as in the image examples that I have the REST API working and the “DATA” API REST variables are normal.

I do not want to place the URL directly because it is an app of technological sales catalog in Spanish, and I want it from an API for the reason of changing the image for another.

But in the Titles, Texts, Prices, etc… Everything works normally.

When I put it in a container and configure it as REPEAT, if it works and the images are linked normally, but the truth is that I only want to show 3 products and not a whole list (I clarify: There was someone who explained me, but as I come from a different platform, I was a little embarrassed to ask how to make REPEAT only show me 3 products from a REST API).

Thank you very much if you can help me.




Problem solved: After testing, it turns out and I happen to work with a REST API taken from App Script from Excel. When I configure my App Script, it takes the information from Excel and must fill the fields that are unfilled, and so when App Script gives me the JSON format to update my AppGyver database. In case I want it with unfilled fields, I only fill with invisible characters or invisible text and it gives me a good result without generating the mentioned error.

When working with REST APIs taken from “AirTable”, “SeaTable”, “Firebase”, etc… there are not these kinds of problems. Only the problem is of my REST API that works more differently when offering its content to the AppGyver database.

Hey Diag,
Kind of unrelated to your topic but did you follow a specific tutorial for connecting your google sheets API via Appgyver’s REST API connector?

1 Like

Hello, of course.

In this video they teach as I learned it, although I am very loose with AppGyver because I come from Kodular, Glide, Adalo, among others and lately I really like AppGyver.

In the video: At minute 6:34 I copy that JSON and paste it into the REST API of “https://www.mockachino.com/” to configure it with AppGyver and create the database.

Here I leave better the link of the video 1 (Because the AppGyver editor marks me the videos as unavailable, when in fact if they are, better copy the link and paste it in YouTube (Excel to JSON “Apps Script” configuration):

https://www.youtube.com/watch?v=uJDLT8nh2ps&list=PLHyy-ASSuIBJqWUNUPtpHuAnYcFExoomH&index=6

All the changes you make in Excel, is reflected in “Apps Script” to copy and paste in “Mockachino”, you don’t have to reopen AppGyver because the changes will be reflected when you modify in “Mockachino”.

Link to video 2 (Mockachino" configuration for AppGyver):

https://www.youtube.com/watch?v=xmEvPHHAvOM&t=357s

Here is the code of the “Apps Script” Script:

function doGet(e) {

  var ss = SpreadsheetApp.openByUrl("Here goes the link to the excel sheet");
  var sheet = ss.getSheetByName("Here is the sheet name");

  return getUsers(sheet);

}

function getUsers(sheet) {
  var jo = {};
  var dataArray = [];
  var rows = sheet.getRange(2, 1, sheet.getLastRow() - 1, sheet.getLastColumn()).getValues();

  for (var i = 0, l = rows.length; i < l; i++) {
    var dataRow = rows[i];
    var record = {};
    record['Example1'] = dataRow[0];
    record['Example2'] = dataRow[1];
    record['Example3'] = dataRow[2];
    record['Example4'] = dataRow[3];
    record['Example5'] = dataRow[4];
    record['Example6'] = dataRow[5];
    record['Example7'] = dataRow[6];
    record['Example8'] = dataRow[7];
    record['Example9'] = dataRow[8];
    record['Example10'] = dataRow[9];
    record['Example11'] = dataRow[10];
    record['Example12'] = dataRow[11];

    dataArray.push(record);
  }

  jo.user = dataArray;

  var result = JSON.stringify(jo);

  return ContentService.createTextOutput(result).setMimeType(ContentService.MimeType.JSON);
}
1 Like

Very much appreciated!
It will help quite a few readers too.
Thanks!

1 Like