Import data

We highly recommend reading the guided tour and understanding model flow before this section. Furthermore, some experience with the Berkeley Studio is recommended.

When a user starts a case, data about the user, like his company’s id has to be entered. In 4.9, it is possible to get the data of another case, so users will not be forced to re-type information.

Or when a user is working on a case, the user can submit data, like the address of a client. In another model, the user will also have to submit (an re-type) that data.

The construction works with two functions, importcasename, to select the case, and importvalue, to get the data. Importvalue needs the casename determined by importcasename.

Selecting case

First, it is important to realize that getting data from another case can be dangerous, because you risk giving information away that you do not want.

The software prohibits too easy access; getting data from other cases only works if the user is identified (so no anonymous login) and the only data you can gather is from cases of that same user. Also, the model must be set to be saving cases.

The first step is to get a casename. You can use the function importcasename. If you just call importcasename, the result will be the last case, not the current, the user has created.

You can also add a SELECTIONRULE, importcasename(‘SELECTIONRULE’), e.g. importcase(‘ = my last name’). Now the result will the last case, not the current, of the user, where the value of the graph main, node start, data name equals ‘my last name’.

The structure of the selectionrule is <VAR> <OPERATOR> <VALUE>, where OPERATOR can be =, <, <=, > or >=. The value is given without quotes. You can use the normal operations, like ' = ’ +, where the selected case will have the same value in as the current case.

You can select a case of a different model, by also giving the modelname to the function: importcasename(SELECTIONRULE, MODELNAME), e.g. importcase(‘ = my last name’, ‘othermodel’). Again, the user must be the same.

If no case is found, the result will be empty.

Importing data

Now that is clear which case can be used, the data can be imported by importvalue. Importvalue needs the name of the data in text, and the casename, e.g. importvalue(‘main.start.personid’, casename). If another model is used, again, the modelname must be specified as a third parameter, e.g. importvalue(‘main.start.personid’, casename, ‘mymodel’);

Finishing up

So, to get back at the examples at the top, if you want the last companyid a user entered in his last case (which is in, the right functions are:

importing last data
importing last data

If a user has worked on a client of a different model (clientintake), to get the clients address (main.clientinfo.address) use this construction. To get the right address, you need to be sure you got the right client. Let’s say the id of the client is stored in

importing last data
importing last data