How to create a progress bar display?

Since FMP does not have an object model where you, say, can tell an object to resize itself (possibly with a color for a progress bar) to a particular width, how difficult is it, or is it even possible in FileMaker, to implement this basic control?

Thanks!

The easiest way would be to use an EditBox to display string of characters like this one β–ˆβ–ˆ

You add one when your process have gone further:

β–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ

Another would be to use a WebViewer that use some JavaScript code that implements a progress bar. See Filemaker Pro - Progress Indicator - YouTube for an example of this implementation.

1 Like

the answer to this is - like in many other cases - "MBS" (almost as versatile as "42" :grinning:)
https://www.mbsplugins.eu/component_ProgressDialog.shtml

I use it quite often because the users get cooled down while waiting for longer processing to get finalized

2 Likes

I think the web viewer is a good solution.
Thanks!

Thanks.
I try to avoid plug-ins unless no other workaround is possible.
The web viewer idea that @planteg mentioned above looks like a nice way to go about this in FileMaker.

webviewers can be tricky with forcing a refresh while scripts are running on another window or maybe the webviewer can reside on the same layout but be kept hidden when not needed - I suppose there are nice templates for these to be found on the internet

1 Like

That's a good point. Thanks! Maybe MBS is the better route. I just find all the "setup" required for calling an MBS function to be a pain if I can avoid it, that is.

Have you tried this one? I have downloaded it from modular FileMaker org which cannot be accessed currently.

Prog Bars.fmp12 (232 KB)

1 Like

small example snippet for loop with progressbar :sunglasses:

Set Variable [ $fkmlCompany ; Wert: "" ]

---# start:
---# set up count of elements in multiline key, set counter to 1
Variable setzen [ $CountE ; Wert: ElementeAnzahl($fkmlCompany) ]
Variable setzen [ $CounterE ; Wert: 1 ]
---#
---# setup progress dialog: Title will appear as window title, Top Text above the bar, Bottom Text below the bar, can be used for textual feedback to the user with additional counter in a loop

Set Variable [ $PDTitle ; Wert: MBS("ProgressDialog.SetTitle"; "Create Items") ]

Set Variable [ $PDTopText ; Wert: MBS("ProgressDialog.SetTopText"; "processed values") ]

Set Variable [ $PDBottomText ; Wert: MBS("ProgressDialog.SetBottomText"; "here we go") ]

Set Variable [ $PDButtonCaption ; Wert: MBS("ProgressDialog.SetButtonCaption"; "Cancel") ]

Set Variable [ $PDClearImage ; Wert: MBS("ProgressDialog.ClearImage") ]

Set Variable [ $PDSetProgressStart ; Wert: MBS("ProgressDialog.SetProgress";-1) ]

Set Variable [ $PDShow ; Wert: MBS("ProgressDialog.Show") ]
---#

Loop

Set Variable [ $PDSetProgress ; Wert: MBS("ProgressDialog.SetProgress"; $CounterE * 100/$CountE) ]

Set Variable [ $PDBottomText ; Wert: MBS("ProgressDialog.SetBottomText"; GetAsText($CounterE) & " of " & GetAsText($CountE)) ]

---# function loop start

---# get value from multiline key by counter
Set Variable [ $fkCompany ; Wert: GetValue( $fkmlCompany ; $CounterE ) ]

---# function loop stopp
---# catch "Cancel"-button in progress dialog
Exit Loop If [ MBS("ProgressDialog.GetCancel") ]

---# condition for end of loop: counter greater than count, counter incremented in condition by 1 per loop
Exit Loop If [ Let( [ $CounterE = $CounterE + 1] ; $CounterE > $CountE) ]

End Loop
---# stop

Set Variable [ $PDBottomText ; Wert: MBS("ProgressDialog.SetBottomText";"cleaning up …") ]

Pause Script [ Duration (Seconds): 1 ]

Set Variable [ $PDHide ; Wert: MBS("ProgressDialog.Hide") ]

Thanks Sam.

Yikes!

What I'd really like is a rectangle "control" that I can send messages to, liie:

rec.setColor = "Blue"

Then, several (for progress):

rec.setWidth(20);
rec.setWitdh(50);
.
.
.
etc.

in principle, this is a feature that has to be implemented by Claris. Some (or most) of the 'third-party' solutions are too complicated, maybe somewhat tricky
-> feature request

As a workaround, we do a refresh-window every 100 or every 1000 records (etc., depends on number of records to be processed), so that the native slider on top left will be updated... not very elegant, but native

With MBS it looks really like a true progress bar - but becomes tricky if the FileMaker-process has to be interrupted (progress bar will stay on screen..)

Another problem with progress bars is when a vendor does no longer show a progress bar... (installing a new FileMaker version via update - there is no progress bar - but a piece of graphics that moves from left to right, then from right to left... also software install on macOS - there is a progress bar, but that thing won't move for looong time, etc.)

2 Likes

Here's a simple repeating field and 2 global variables with some conditional formatting implementation. Drawback: needs a window refresh to update.
Progressbar.fmp12.zip (72.7 KB)

best
Otmar

2 Likes

I use a button bar with 10 or 20 buttons and color them with conditional formatting, based on a $$Variable. So I have total control over the looks of the button bar like round edges or outlines.

5 Likes

Ingenious!

The OS provides functionality for the implementation of progress indicators (example Apple).
Any β€˜low code’ development platform should either provide its own elements in consistency with the target OS or give access to the OSβ€˜s primitives.

3 Likes

I think you are using a similar approach to the module that @samfmp mentioned above. That uses a button bar.

I used a small library (table) of, let' s say 100 rectangles, one for each %, in combination with a container field that calls the right rectangle when refreshed. Very simple and fast, no plug-ins needed, no Javascript and web viewers.