Save Information

Hi,

is there a way Intuiface can save information to persistent file for later use?

Here is the scenario: My Experience is using a custom interface asset that gets all pdf files present in some folder somewhere on the system. (Actually it only gets the filepaths and intuiface then loads whatever is at that filepath).
The folder in question has to be specified on a special page in the experience. There is a text input, where you simply type in the path to the folder. Specifying the folder in composer is not really an option because the exact location might change from system to system or even after deployment.

The whole thing works fine so far. One problem that I can see in the future is if the system has to restart for whatever reason. In that case the experience would go back to the defaults set in composer and most likely these folders would not exist.
Is there a way I can store the information in a presistent file so I can automatically load it after a system restart?

Regards,

Max

Hi Max,

What does this file you require store?

Kind Regards

Louie

a line of text
the filepath to a folder

or ideally multiple lines of text for multiple folders (if it is possible to deal with it on a line-by-line basis)

Hi Max,

Why cant you store this information inside of an excel worksheet? So when the XP is closed the “Paths” are stored within the experience and will be loaded once the XP starts again?

Kind Regards

1 Like

Can I write into an Excel from intuiface? If so, that would absolutely work!

I could be wrong as I don’t know how your IA works,

So how do you get the file paths from your IA? Could you not create a trigger on a Global Variable when value changes update/add row in the spreadsheet?

So now the path is stored in the XP and it can be transferred on different machines

Kind Regards

1 Like

I was unaware that updating excel cells from an experience was a thing. But that should absolutely work.

My IA simply takes a string, and then interprets said string as a filepath. So yes storing that string in the spreadsheet should do the trick.

I guess the solution was too obvious for me to see…

Thanks!

2 Likes

I’m glad I could make you see through the clouds! :wink:

1 Like

Maybe I am once again missing something obvious but I cannot get it to work.

I have the simplest setup.
A button and a text input.
The button calls the “Update Cell” function of the Excel IA and sets the new value to the “Text” property of the text input.

But this does not have any effect. When I open the Spreadsheet in Excel I can see that the cell has not changed.

At least I can get the info into the experience so this is a workable solution. But as a quality of life feature I would like to be able to change the filepaths from the experience.

I’ve sent you a PM

1 Like

Hi @maximilian.berthold !

Yes of course you can update a cell/row or write new rows to an Excel file.
That’s how we usually store “Settings”.

To name a few XPs from the Marketplace where we do this:

Feel free to download them and dig in. We usually store Ip Addresses, or Credential Key etc.
Just search in each experience for the Excel files.

Don’t forget to check the Excel Interface Asset article here, as you will see, it comes built-in with convenient actions: Add Row, Update Row, Update Cell.

Regards,

Alex.

2 Likes

When updating a specific cell, you need to pay special attention to the particular row the cell is in. If you have multiple rows… you will need to define the row no and the cell for it to write specifically to that cell.

1 Like

Hi @maximilian.berthold,

Excel is one way and as @Alex mentioned, we use it quite often in our own samples / XPs to save settings. It has one downside though: if you publish a new version from your Composer, after making some changes to that Excel file, then deploy to your players again, the Excel file in your Composer will override the local Excel files on your player(s). If you never update the Excel file on your Composer (dedicated file/sheet for these settings), you’re good to go.

Since you already have a custom IA, an alternative would be for you to load/save that value directly from your IA, in a txt, JSON or XML “config” file. Whether your IA is in .NET or in JS, that should be fairly easy to code.

hi,

thanks for all the additional input!
with some help from @Louie_Smith I got it to work!

I had already thought about having my IA handle the reading/writing of these filepaths… but I would have had to go back into the code… and I was way to lazy for that :slight_smile:

Anyway the whole thing is ready to go now. The hardware should be here next week and then we are ready to deploy!

4 Likes