How to get External Image url on to table at time of first save

I while back I wrote my first Appsheets which needed to use the external image path for imported images.

My use case is my website runs code that parses the google sheet and uses that path for the images.

After following the documentation & security setting and using

CONCATENATE(

  "https://www.appsheet.com/template/gettablefileurl ",

  "?appName=", ENCODEURL(CONTEXT("AppName")),

  "&tableName=", ENCODEURL(CONTEXT("Table")),

  "&fileName=", ENCODEURL([AImage])

)

In the column for the imagePath.

 

When an image is uploaded.  The app will display it and use its internal path.

The imagePath column  should concatenate the base path and that image internal path (example Image_Images/8f48b40f.Image.201241.jpg ).

 

But although the image's internal path is recorded it is not available immediately at the start of the edit where its seems the concatenate is computed.

This means the base url is added to the imagePath minus the filename/internal path.

When you save the entry, the image path is recorded to the table as expected but the imageUrl is incomplete, missing the Image_Images/8f48b40f.Image.201241.jpg on the end.

---

Some how I figured how to get around this because the app had been working for the last year or so.

And we did not need to add any new entries up until recently.

But some how my fix had been wiped ?.

Not sure how that happened and to be honest I am not 100% what I did back then.

So I had to re do a fix.

 

For those of you who need to do this, this is what I have done ( probably not what I did last time)

 

(After following the instructions to create an external path.)

1,

On the table I have a column name imageUrl,

In the app imageUrl will not be shown

 

2,

On the table I have column name banner image

In the App this will be a Thumbnail picker. Which will populate the banner image column in the sheet with the internal file path/name as a string

3,

On the table I create a new column forImagePatheMergWithBannerImage and regenerate table in the app.

4,  I add the formula

CONCATENATE(

  "https://www.appsheet.com/template/gettablefileurl ",

  "?appName=", ENCODEURL(CONTEXT("AppName")),

  "&tableName=", ENCODEURL(CONTEXT("Table"))

)

 to forImagePatheMergWithBannerImage.  Note no filename

 

5,

On the Sheet and in the first cell of the imageUrl column I add the formula.

=ArrayFormula(P2:P100&E2:E100)

This will take the values of the forImagePatheMergWithBannerImage column ( P2:P100 range) and append the values of the imageUrl  (E2:E100) column to it.

 

All imageUrl cells will now populate with the full image external path.

 

I hope this helps any one else and this also helps me remember if I get the odd regression again.

 

 

 

 

1 0 287
0 REPLIES 0
Top Labels in this Space