SNAPSHOT() of XY MAP not rendering in HTML template

Hi,

I've searched the forum and I'm still stuck.

I have an XY Map view called layouts which works as desired and is shown below. This view generates when a button-based action fires in the app. Here's the expression in that action: LINKTOFILTEREDVIEW("Layouts", [id] = [_THISROW].[id])

image rendered.png

Here's my issue.

When I run a bot to generate an email, with an HTML template, the bot works, sends the template, the data in the template table is correct, except for one thing... The SNAPSHOT() function shows a blank app screen as shown below.

This is the line of code I'm using in the HTML file to call the XY MAP view. I don't get any errors. It's just a blank, as if there's no data...?

I have set the bot to bypass security filters.

<<SNAPSHOT(LINKTOFILTEREDVIEW("Layouts", [id] = [_THISROW].[id]))>>

image not rendered.png

I've been banging my head on this thing for some time now and, I'd be very grateful for some help here.

@Fabian_Weller, your name keeps popping up in the forum for map stuff so I've cheekily tagged you. Hope that's OK.

Many thanks in advance... ๐Ÿ™‚ 

Solved Solved
1 17 457
1 ACCEPTED SOLUTION

You are welcome. Sure, I think if would be some peculiar setting that someone could take a close look at in the app itself. So support ticket sounds a good option. 

Edit: My one request to you will be to base the "Layouts" view also on the slice "QA Approved" just for testing purpose and test if the SNAPSHOT(0 function works. In my testing , one difference is I do not have two different slices. In fact both the views are based on table.

View solution in original post

17 REPLIES 17

Generally , your expression seems to be good.

I tested with the following HTML code in the email body and it works.

Suvrutt_Gurjar_0-1706586691814.png

 

<html>
<head>
</head>
<body>
&lt;&lt;SNAPSHOT(LINKTOFILTEREDVIEW(&quot;Orders_Detail&quot;, [Order id] = [_THISROW].[Order id]))&gt;&gt;
</body>
</html>

Of course view name and column name were different in my testing. You could suitably replace as below

<html>
<head>
</head>
<body>
&lt;&lt;SNAPSHOT(LINKTOFILTEREDVIEW(&quot;Layouts&quot;, [id] = [_THISROW].[id]))&gt;&gt;
</body>
</html>

The email sent properly captured the snapshot image in my testing as shown below.

Suvrutt_Gurjar_1-1706586839818.png

 

Hi @Suvrutt_Gurjar ... Thanks for taking the time to test... Much appreciated... ๐Ÿ‘

I will strip mine down to basics, test again, and report back ASAP.

Cheers... ๐Ÿ˜‰

Hi @Suvrutt_Gurjar ... I'm still bumping my head against this thing. I can get the view to show in my HTML template, but it just doesn't seem to hold any row data...? Here's a detailed look at my setup... ๐Ÿค”

 

I have a QA APPROVED VIEW

 

B1.png

 

Which looks at the QA APPROVED DATA SLICE of the surveys table.

 

B2.png

 

Here's what it looks like in the app:

 

B5.png

 

When I click on the inline bulb icon, it fires an action to update to the [trigger] column in the surveys table.

 

B3.png

 

Here's the associated trigger action.

 

B4.png

 

I have a test_approved_BOT that is listening for the following condition:

AND(

[QA_status] = "QA Approved",

[_THISROW_BEFORE].[trigger] <> [_THISROW_AFTER].[trigger]

)

 

B6.png

 

When the condition is met, the bot sends an email:

 

B7.png

 

The bot uses an EMAIL BODY TEMPLATE that points to an HTML file:

.../AppSheet/data/Pre-Installation-CRMS/Templates/test.html

 

B8.png

 

Here's the HTML file:

 
<html>
<head>
</head>
<body>
 
&lt;&lt;SNAPSHOT(LINKTOFILTEREDVIEW(&quot;Layouts&quot;, [id] = [_THISROW].[id]))&gt;&gt;
 
</body>
</html>
 
The bot runs without errors, sends the email, processes the html template, shows the Layouts view in the body of the email, but produces an empty-looking result shown here:
 
B Result.png
 
The action/bot combination gives me the wrong result but I get the correct result when I fire the action manually in the app using an MAP VIEW action icon from the detail view.
 
B9.png
 
The MAP VIEW action icon goes to another view within the app:
 
LINKTOFILTEREDVIEW("Layouts", [id] = [_THISROW].[id])
 
B10.png
 
And produces the correct result... i.e. a pin on a map
 
B11.png
 
This is the view I'd like to see in my HTML email body template.
 
The head scratch is that it works when done manually but not via the action/bot combination.
 
I've very stuck right now.
 
Hope this makes sense.

JSO
Silver 2
Silver 2

I don't know what it could be since it worked for another user.

Check to see if the problem is the included characters. The user for whom it worked changed the << >> and others for characters &:

JSO_0-1706615456130.png

I think the problem is the limitation that a bot has in handling calls to view presentations.
Perhaps a solution would be to generate a preview image of what you want to present in a column and put said column in the HTML instead of calling LINKTOFILTEREDVIEW()

Hi @JSO... Thanks for that suggestion... Sounds interesting and less complicated... ๐Ÿ˜‰

Please could you very briefly outline the basic high-level steps to do that...?

Hopefully that'll be enough to point me in the right direction.

Many thanks... ๐Ÿ˜‰

I think it could work if you create a virtual column of type image and whose content is:

SNAPSHOT(LINKTOFILTEREDVIEW("Designs", [id] = [_THISROW].[id]))

Then that column is included in the body of the HTML.

I haven't checked it, so I can't give certainty.

If there are many rows, it will be more profitable to work with a real column in the Sheet.

Thanks @JSO ... That makes sense... I'll give that a go right away... Cheers... ๐Ÿ˜‰

Thanks for your support with this one @JSO & @Suvrutt_Gurjar.

I tested SNAPSHOT() thoroughly, but ultimately gave up on it.

@JSO, you mentioned using a separate spreadsheet/virtual column to do the heavy lifting of the SNAPSHOT(LINKTOFILTEREDVIEW... I tried many versions of that and gave up there too.

However, you led me to thinking about a helper-column. I now have a working image column that fetches a saved floor plan image from a folder, and shows it in my HTML Email Body Template.

For the moment I do not have a location pin, but I will keep working on this.

Thank you both... ๐Ÿ˜‰

Hi @jakenaude ,

Thank you for all details and sorry for a bit late revert as I wanted to test with exactly similar condition as yours , meaning with an XY column based image. My yesterday's testing was with all similar conditions as yours but LINKTOFILTEREDVIEW() applied on a general detail view and not a map view.

My current testing with both Google map view and an XY image based column still give correct results in the email body. Please see the SNAPSHOT() produced on a XY image testing.

The image of the email body received through bot is shown below. The test background image of the XY column of a soccer field is with dark green background so it is a bit difficult to see the map pin. So I have highlighted it with a red circle. 

Suvrutt_Gurjar_1-1706674867509.png

 

All in all, my testing with XY column is successful. 

At this point, would you please mention how the table/slice used for the "Layout" view is related to the "Surveys" table?

Hi @Suvrutt_Gurjar... Your extensive testing and perseverance is much appreciated... ๐Ÿ˜‰

I will go ahead and also test this approach: LINKTOFILTEREDVIEW() applied on a general detail view and not a map view

The Layouts view uses Layouts slice on the surveys table, and has an updates and adds relationship. 

C1.png

 

Thank you. I think slice expression for the Layouts view also looks good. Since slice has an expression of NOT([QA_Status]) ="Permannt Record"), it should select all the records such as [QA_Status]="QA Approved" which is a status for the other slice and the bot firing condition.

So all looks good. And since the action works well with "Layouts" view, it means the map view is also set up properly.

So all looks good for now and not more to suggest at this moment.๐Ÿ™‚ At least it is working on a similar set up for me.๐Ÿ™‚

Thanks @Suvrutt_Gurjar... I appreciate your efforts...

Please could you give me some guidance on one thing...?

I'd like to reconstruct the process as you did but I'm having difficulty understanding the steps to apply LINKTOFILTEREDVIEW() on a general detail view and not a map view

I've created a detail view called Layouts General Detail but I'm failing to show the XY image and the pin in there.

Please could you highlight the basic, high-level steps for me...?

A few bullet points should do the trick...?

Many thanks... ๐Ÿ˜‰


@jakenaude wrote:

l but I'm failing to show the XY image and the pin in there.


Hi @jakenaude , 

I am afraid, as per my understanding,  you will be unable to show the XY image and pin in the detail view.  I had mentioned detail view just to test the SNAPSHOT() function works in the HTML template when I started responding to your post,  As a side note AppSheet help documents mentioned that displaying XY column image in a template is not possible. 

Suvrutt_Gurjar_0-1706700670218.png

Display Address, LatLong, and XY values in templates - AppSheet Help

So your workaround of using SNAPSHOT() seems to be good approach to overcome above limitation.

To clarify , I think we tested the issue in two steps

1) To ensure SNAPSHOT() works in HTML template: this was established by testing a detail view with SNAPSHOT()  in HTML template

2) SNAPSHOT() with map view works in an HTML template. My testing showed that it works with map view as well. However we are unable to get it working in your setup even though our settings and approach seems to be similar.

Hope I could explain.

Hi @Suvrutt_Gurjar... OK buddy... I thank you for your time and efforts... We got so, so close... If it works for you, it should work for me right...? I'll raise a support ticket and ask them to see what I'm doing differently to you. Thanks again. Much appreciated... ๐Ÿ˜‰ ๐Ÿ˜‰ ๐Ÿ˜‰

You are welcome. Sure, I think if would be some peculiar setting that someone could take a close look at in the app itself. So support ticket sounds a good option. 

Edit: My one request to you will be to base the "Layouts" view also on the slice "QA Approved" just for testing purpose and test if the SNAPSHOT(0 function works. In my testing , one difference is I do not have two different slices. In fact both the views are based on table.

"...one request to you will be to base the "Layouts" view also on the slice "QA Approved..."

@Suvrutt_Gurjar, you are a rock star dude...!!! Thanks for not giving up!

Pointing the Layouts view to a new slice did the trick...!!! Here's the result... ๐Ÿ˜‰ ๐Ÿ˜ ๐Ÿ˜Ž

C2.png

Wow ! That is great. Glad  to know you have it working. Thanks to you as well for always providing elaborate details and testing out the options. A good collaboration does make the difference for such solutions. 

All the best.

Top Labels in this Space