We’re launching the OpenC Connectors for Claris Connect! Read more here.

OpenC
Blog Claris Studio

Two ways to pass data from outside into Claris Studio views

No payload, no party!

Romein van Buren Romein van Buren

You care about your customers, so you are planning to email them a survey. And, naturally, you turn to Claris Studio for this.

But your customers don’t care about your survey at all, so they want to spend as little time as possible. Alright, they might be willing to leave some feedback, but the last thing you should want them to have to do is to manually type their name, age, client number, contract type, country of residence, industry, number of late payments, name of their account manager, net revenue, … you get it.

So you want to pass that data to the view beforehand, dynamically.

Too much for Claris Studio? No!

Better yet, it gives us not one but two options to pass data from outside into forms and custom views. Both result in a custom link that you can e.g. share in an email or present as a QR code.

(When editing the link, please use TextEdit or Notepad instead of a rich text editor. This way, you make sure that, when copying the link, you copy the actual link and not a label. If you use a rich text editor, you may risk editing the label instead of the link and end up copying the original link instead of the changed one.)

#1: Pre-filled form links

The first method works only with form views. First, make sure the form is published. Click the Share button in the top toolbar and toggle the “Sharing Link Enabled” switch. You will be presented with a link, but that one is not prefilled yet. Click the “Configure” button on the bottom to start configuring the pre-filled link.

Claris Studio form sharing

Then, we are presented with some options. We recommend keeping the spreadsheet picker set to “No Spreadsheet”, because this will allow for the highest flexibility of using the link. Add the fields you need to be available in your URL. In the “Pre-filled Data” field, add short, easy-to-remember strings. Then, click Next to save it and you will see your pre-filled link on the bottom of the window.

Pre-filled link options

This is our link (try it here):

Studio URL anatomy prefilled

The URL now has two key-value pairs separated by a & that form the query parameters (the part after the ? and before the #):

See the NUMBER and NAME placeholders we added in the “Pre-filled Data” fields? You can now (programmatically) replace them with the value you want.

Make sure you keep the query parameters before the #, as is done when you copy the link from the dialog. Also, URL encode the values if they contain weird characters like !@#%*^$. There is a FileMaker function for this.

#2: Encoded JSON payload

The second method is a bit less straightforward, but it’s supported by all view types, not just forms. It works by appending a Base64 encoded JSON payload to the URL:

With {"ClientName": "Jan", "ClientNr": 2} as JSON data, the URL will become this:

Studio URL anatomy _ctx

Note that the encoded JSON is preceded by the ?_ctx part.

There is a Base64Encode function in FileMaker and Claris Connect also has one available in the “Text” set of utilities. You can use an online tool as well for testing purposes, but note that you will not be able to replace variables after encoding. (Needless to say, but be careful with sensitive data when using such online tools.)

One more step is required for this to work. Passing a payload this way gives us access to a context variable in Studio calculations, and we need to make sure the field is pre-filled with the context data by setting a default value based on a calculation. In our case, that is context.ClientName and context.ClientNr, because ClientName and ClientNr are the field names in our JSON object.

Context

You need a calculation for this, which means using the context variable is not limited to just fields! Don’t take my word for it: see for yourself that this works too.

Mix & match

You can even combine the two methods, e.g. by passing Kortetekst=NUM as query parameter and {"ClientName": "Jan"} as Base64 encoded JSON. Try it!

Studio URL anatomy combined

Real-world use cases

OpenC is currently using method #1 and exploring method #2 to simplify customer due dilligence for a Dutch insurance company, verifying multiple 10s of clients each week. They went from multiple sheets of paper per client per week to … zero sheets of paper, and the clients do not have to write out all their details on paper anymore.

How are you using these possibilities to create pre-filled links in Claris Studio? Share your experiences in the comments below!

Comments (0)