Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How can I attach a button to a container field that prompts user to select an image to be inserted?

Featured Replies

I have some elderly users that are challenged by doing a right-click on a container field to insert an image. How can I attach a button to the container field so whenever they click on it a dialog pops up that prompts them to select an image from their hard drive?

The users are all on Macs.

Edited by HALBURN

Put clear button over the entire container field, make sure it's on top.  

A script could branch so if a user has an image in the container field, it can ask to delete or replace, if no image in container field, do the steps to add one.

 

  • Author
On 5/2/2020 at 12:24 PM, Steve Martino said:

Put clear button over the entire container field, make sure it's on top.  

A script could branch so if a user has an image in the container field, it can ask to delete or replace, if no image in container field, do the steps to add one.

 

Thanks. The part that I am having trouble with is what script step would prompt the user to select an image from their hard drive? I tried the Insert Image script step (I am not at my computer at the moment) but I think this forces me to select the image when I am defining the script instead of allowing the user to select the image when they execute the script.

 

Edited by HALBURN

It's insert Picture, not Insert Image. If you don't specify a source file, Filemaker will display a dialog for choosing the file to insert. Note that you must activate the target field before calling this step. 

A better option is to use the Insert File step, that lets you specify the target field (and a few other things). To insert an image, select the Display: • Content of file (when possible) option.

 

  • Author
16 minutes ago, comment said:

It's insert Picture, not Insert Image. If you don't specify a source file, Filemaker will display a dialog for choosing the file to insert. Note that you must activate the target field before calling this step. 

A better option is to use the Insert File step, that lets you specify the target field (and a few other things). To insert an image, select the Display: • Content of file (when possible) option.

 

Thanks comment.

It's been a while since I have used FileMaker. I am trying to create a single script that I can use on 10 different container fields. I have given each container field an object name and I am telling the script to go to that object before the "Insert File" step. Unfortunately this is not working. It returns and error [3] Command is not available. Can you please tell me what I am doing wrong?

1 minute ago, HALBURN said:

Can you please tell me what I am doing wrong?

No, not without seeing the script and the contents of the parameter.

 

11 minutes ago, HALBURN said:

I have given each container field an object name and I am telling the script to go to that object before the "Insert File" step.

Note that with the Insert File script step, you could insert the file into a variable first, then use the Set Field By Name step to pass it to the selected field. This would enable you to perform the entire operation at the data level, without relying on any layout objects.

 

8 minutes ago, HALBURN said:

I am trying to create a single script that I can use on 10 different container fields.

This raises a red flag for me. What is the use for 10 container fields? Shouldn't they be records in a related table instead?

 

  • Author
32 minutes ago, comment said:

No, not without seeing the script and the contents of the paramete

This is the script.

image.png.aceda85a76f3e136aa45143d0f43ceae.png

FileMaker Pro Advanced Clipping (2∶36∶08 AM) 3.png

32 minutes ago, comment said:

This raises a red flag for me. What is the use for 10 container fields? Shouldn't they be records in a related table instead?

 

Yes. I am aware. Trust me, there is a reason. :)

Edited by HALBURN

  • Author
1 hour ago, comment said:

No, not without seeing the script and the contents of the parameter.

 

Note that with the Insert File script step, you could insert the file into a variable first, then use the Set Field By Name step to pass it to the selected field. This would enable you to perform the entire operation at the data level, without relying on any layout objects.

 

This raises a red flag for me. What is the use for 10 container fields? Shouldn't they be records in a related table instead?

 

Thanks for your help. I ended up brute forcing it with a separate script for each image.

I am getting too old to remember this stuff. :)

 

I am afraid I can't detect anything wrong with the script (other than wasting memory on duplicating the script parameter to a variable). At what point do you get the error?

 

  • Author
8 minutes ago, comment said:

I am afraid I can't detect anything wrong with the script (other than wasting memory on duplicating the script parameter to a variable). At what point do you get the error?

 

On the Insert File step. No worries. I have it working.

Thanks again for you help.

I cannot reproduce your problem - see the attached file.

InsertImage.fmp12

  • Author
2 minutes ago, comment said:

I cannot reproduce your problem - see the attached file.

InsertImage.fmp12 156 kB · 2 downloads

Thanks very much. I see the problem. For some reason it does not work if the container field is is also the button.

17 minutes ago, HALBURN said:

it does not work if the container field is is also the button.

It should. Are you sure the object name is assigned to the field, not to the button?

 

Edited by comment

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.