Email Image attachment not working

Hello Appsheet community,

I have a problem sending emails with one or more image attachments.
The email is always sent but without the attachments that I would like to deliver.

The data source of the App is a Google Sheet.
The email sending is executed by a bot, which is triggered when a new entry in the sheet โ€œBAU_RECORDSโ€ is added.
However, the path to the attachment(s) is stored in a sheet named โ€œBAU_ATTACHMENTSโ€. The link/join between these two sheets is a ref column in the sheet โ€œBAU_ATTACHMENTSโ€. If there are multiple attachments for one row in the sheet โ€œBAU_RECORDSโ€, that many rows are added in the sheet โ€œBAU_ATTACHMENTSโ€ with the same REC_ID from the sheet โ€œBAU_RECORDSโ€.

I know that you can change the default app folder in the info tab:

I tried already all kinds of combinations for the default app folder and the expression in the Other Attachments tab of the bot.
3X_8_c_8c0370dba015cff9ad0eb223cae61e0a387eaf31.png

Nothing worked with an expression, I only managed to make it work with plain text of a file name of an image and the appropriate default app folder. Unfortunately this is not sufficient, as I always want to send the new images of the entries and not a static image.

Here are some examples of the expressions I tried in the Other Attachments tab of the bot:

When changing the result of the folder path I always changed the default app folder in a way that it should work.

Any help would be appreciated!
Regards,
Linus

Solved Solved
0 8 579
1 ACCEPTED SOLUTION

Thank you for sharing these details. Yes, valid points and observation. That is a most likely a possibility. Please take a look at the following sample app and help articles

Topic: Why is the parent record displayed but the child records are missing?
Article:

Topic: โ€œSending Email Only After Adding a Parent Record and All of Its Childrenโ€

Article :

Sample App:
https://www.appsheet.com/samples/Send-an-email-when-children-are-added?appGuidString=75e6fdb0-7d89-4...

View solution in original post

8 REPLIES 8

This input is about your expression for Other attachments. Your first expression in general looks good to select images from the child table. The expression with SELECT() statement.

Have you seen how it looks in the test results pane? For example on a test app, I could see the associated images being selected for that particular parent record. Those particular images also appeared in the email also as attachments.

Display Images is the child table as below . MyImage ID is the referenced ID of the parent table

In the results pane it looks like this:

In comparison to your entries in the Image column, in my app there are no indices/numbers reflecting the ID in the image file names (the parts you marked orange).

This is how the the column settings for ATT_PHOTO are:

Actually, your setup seems to be identical and good. You do have those indices you mention. Those are nothing but key of the record. I have highlighted it below in your records as well. In the record, you will find those collective indices in a column called something like [Related BAU_ATTACHMENTS]

Even in the latest image shared by you the photo files seem to have properly got selected.
You may wish to test BOT once without the default app folder ( making the entry in that setting blank) , I mean without the main attachment. This will ensure your image attachments (other attachments) are running well.

You may otherwise wish to see where the BOT is failing.

If I try to make the entry blank for the default app folder and save the app, it sets the default app folder again.

Monitoring the bot did not help me yet, as the bot status is โ€œCompleteโ€ most of the time without showing any errors. The errors in the screenshot happened when I changed some expression.

Is it possible that new rows for different tables are not added synchronously?
For example, the BOT is triggered when a new row in the table โ€œBAU_RECORDSโ€ is added. But when the BOT is running, the new row(s) in table โ€œBAU_ATTACHMENTSโ€. storing the path to the images, are not existing yet?
In the Monitor section of the BOT, if I take a look at the inputs, some virtual columns depending on values of the โ€œBAU_ATTACHMENTSโ€ table are blank:

The column [REC_ATT_IMAGE] is a virtual column in table โ€œBAU_RECORDSโ€ with the following expression:
SELECT(BAU_ATTACHMENTS[ATT_PHOTO],([ATT_REC_ID] = [_THISROW].[REC_ID]))

If I test this expression in the results pane, it shows results, as already shown in previous screenshots:

I guess that might be the problem. When the BOT is running it tries to access rows in the โ€œBAU_ATTACHMENTSโ€ table, but those rows are not existing yet.

Thank you for sharing these details. Yes, valid points and observation. That is a most likely a possibility. Please take a look at the following sample app and help articles

Topic: Why is the parent record displayed but the child records are missing?
Article:

Topic: โ€œSending Email Only After Adding a Parent Record and All of Its Childrenโ€

Article :

Sample App:
https://www.appsheet.com/samples/Send-an-email-when-children-are-added?appGuidString=75e6fdb0-7d89-4...

I managed to make it work thanks to the description of the sample App you shared.

Thank you so much for your help!

You are welcome. Good to know it works as per your requirements.

I must say that the inputs you shared were methodical and your own analysis was also good.

All the best with your apps creation.

Top Labels in this Space