Portal Filter Scripting in FileMaker with Window Variables

Portal filtering can involve a number of small scripts for setting fields, clearing fields, and refreshing the portal. I’ve long been meaning to build one that would do it all, and that day has come!

This one script can be re-used anywhere without modification. Pass in some simple JSON to set one or more fields, one or more global variables, one or more window variables, THEN refresh one or more portals!

Wait… did someone say “window variables”? The attached file demonstrates that concept too. This allows you to have the same layout & record open in multiple windows, but have different filters applied in each window… cool!

This script uses FileMaker’s native JSON functions (introduced in version 16). I recommend using these for all your Script Parameter passing needs.

Example Script Parameter to clear one field and then refresh the portal.

JSONSetElement ( "" ; 
  [ "portal_name" ; "portal_object_name" ; JSONString ];
  [ "set[0].field" ; GetFieldName ( Table::FieldName ) ; JSONString ]

Example Script Parameter to set 1 field, set 1 global variable, then refresh two portals.

JSONSetElement ( "" ; 
  [ "portal_name" ; "portal_object_name¶additional_portal_object_name" ; JSONString ]; 
  [ "set[0].field" ; GetFieldName ( Table::FieldName ) ; JSONString ]; 
  [ "set[0].value" ; "new_field_value" ; JSONString ]; 
  [ "set[1].globalvar" ; "variable_name" ; JSONString ]; 
  [ "set[1].value" ; "new_variable_value" ; JSONString ] )

You can pass as many fields, variables, and window variables as you wish. Just be sure to start at set[0], and increment by 1 for each additional thing you set.

Download the sample file. RefreshPortalScript.fmp12. Works in FileMaker 16+.

And there you have it! Do you see problems or have comments, questions, or suggestions for improvement? Please share in the comments!

While building this file I noticed what I believe is a bug in the “Refresh Portal” script step. The sample file compensates by using “Refresh Window” when window variables are used. I posted more details about this in the FileMaker Community.

3,298 Replies to “Portal Filter Scripting in FileMaker with Window Variables”

  1. Hi, I do believe this is a great site. I stumbledupon it 😉 I
    may come back once again since I book-marked it.

    Money and freedom is the best way to change, may you be rich and continue to guide other people.

  2. Hiya, I’m really glad I’ve found this information. Nowadays bloggers publish just about gossip and net stuff and this is actually frustrating. A good site with exciting content, this is what I need. Thank you for making this web-site, and I’ll be visiting again. Do you do newsletters by email?

  3. Excellent blog here! Also your site loads up very fast! What web host are you using? Can I get your affiliate link to your host? I wish my web site loaded up as quickly as yours lol|

  4. Howdy! This post could not be written much better! Going through this post reminds me of my previous roommate! He constantly kept preaching about this. I am going to forward this post to him. Fairly certain he will have a good read. Thank you for sharing!|

  5. Nice blog here! Also your site loads up very fast! What web host are you using? Can I get your affiliate link to your host? I wish my website loaded up as fast as yours lol|

  6. Oh my goodness! Impressive article dude! Many thanks, However I am experiencing issues with your RSS. I don’t understand the reason why I can’t subscribe to it. Is there anybody getting similar RSS issues? Anyone who knows the answer will you kindly respond? Thanks!!|

  7. You’ve made some good points there. I checked on the net to find out more about the issue and found most individuals will go along with your views on this website.|

  8. Hello there! This is kind of off topic but I need some advice from an established blog. Is it difficult to set up your own blog? I’m not very techincal but I can figure things out pretty quick. I’m thinking about creating my own but I’m not sure where to start. Do you have any points or suggestions? Many thanks|

  9. Greetings from Idaho! I’m bored at work so I decided to browse your site on my iphone during lunch break. I enjoy the info you present here and can’t wait to take a look when I get home. I’m shocked at how quick your blog loaded on my phone .. I’m not even using WIFI, just 3G .. Anyways, excellent blog!|

    1. Greetings I am so happy I found your website, I really found you by accident, while I was browsing on Bing for something else, Regardless I am here
      now and would just like to say thanks a lot for a fantastic
      post and a all round enjoyable blog (I also love
      the theme/design), I don’t have time to browse it all at the minute
      but I have bookmarked it and also included your RSS
      feeds, so when I have time I will be back to read a
      lot more, Please do keep up the excellent work.

  10. “Great article and right to the point. I don’t know if this is in fact the best place to ask but do you folks have any thoughts on where to get some professional writers? Thank you ??”

  11. Hi would you mind letting me know which web host you’re working with? I’ve loaded your blog in 3 different browsers and I must say this blog loads a lot faster then most. Can you recommend a good hosting provider at a reasonable price? Many thanks, I appreciate it!|

  12. I loved as much as you’ll receive carried out right here. The sketch is tasteful, your authored material stylish. nonetheless, you command get got an edginess over that you wish be delivering the following. unwell unquestionably come further formerly again since exactly the same nearly very often inside case you shield this increase.|

  13. When I initially commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added I get three emails with the same comment. Is there any way you can remove me from that service? Thank you!|

  14. Hi there, i read your blog occasionally and i own a similar one and i was just curious if you get a lot of spam comments? If so how do you stop it, any plugin or anything you can recommend? I get so much lately it’s driving me insane so any support is very much appreciated.|

  15. Thanks for your personal marvelous posting! I definitely enjoyed reading it, you are a great author. I will always bookmark your blog and definitely will come back later on. I want to encourage yourself to continue your great work, have a nice weekend!|

  16. Great items from you, man. I have remember your stuff prior to and you’re just extremely fantastic. I really like what you’ve bought right here, certainly like what you’re stating and the way in which through which you assert it. You are making it enjoyable and you still take care of to keep it wise. I cant wait to learn much more from you. This is really a tremendous web site.|

  17. Good website! I truly love how it is easy on my eyes and the data are well written. I am wondering
    how I might be notified whenever a new post has been made.
    I have subscribed to your feed which must do the trick!
    Have a nice day!

  18. Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that automatically tweet my newest twitter updates. I’ve been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this. Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates.|

  19. My spouse and I stumbled over here from a different page and thought I might as well check things out.
    I like what I see so i am just following you. Look forward to looking into your web page again.

  20. Hello! Someone in my Facebook group shared this website
    with us so I came to check it out. I’m definitely loving
    the information. I’m bookmarking and will be tweeting this to my
    followers! Terrific blog and terrific design.

  21. [url=https://fluoxetinemed.com/]fluoxetine 20mg tablets uk[/url] [url=https://augmentinmed.com/]buy augmentin[/url] [url=https://buspar365.com/]buspar 20 mg[/url] [url=https://tretinoint.com/]buy tretinoin gel[/url] [url=https://lexepro.com/]lexapro 2.5[/url]

  22. Nice post. I was checking continuously this weblog and I’m inspired!
    Very helpful information specially the remaining part 🙂 I
    handle such info much. I was looking for
    this particular information for a very lengthy time.
    Thanks and good luck.

  23. I believe what you composed was very logical. However, what about this? suppose you wrote a catchier post title? I mean, I don’t want to tell you how to run your website, but what if you added a title that makes people want more? I mean BLOG_TITLE is kinda vanilla. You could peek at Yahoo’s front page and watch how they create post headlines to get viewers to open the links. You might add a video or a picture or two to get readers excited about what you’ve written. Just my opinion, it would make your posts a little livelier.|

  24. Pretty section of content. I just stumbled upon your web site and in accession capital
    to assert that I acquire actually loved account your blog posts.
    Anyway I will be subscribing to your augment
    or even I success you access constantly rapidly.

  25. Hello! Someone in my Facebook group shared this website with us
    so I came to look it over. I’m definitely loving the information. I’m book-marking and will
    be tweeting this to my followers! Excellent blog and fantastic design.

    Feel free to surf to my web site :: nclex rn test, https://gust.com/,

  26. I’m still learning from you, as I’m trying to achieve my goals.
    I definitely enjoy reading all that is posted on your
    site.Keep the posts coming. I enjoyed it!

    My web blog :: create a multiple choice exam [medium.com]