The Split loop is used to split a text value and store each part separately as rows in a list in the database. This method can be used to separate a row of a CSV document, break-up date values and split other character separated texts.
To achieve this a custom loop needs to be created with the split function at its core:
Create a transient numeric field called Index to keep track of the current item.
Create a numeric ItemCount field to count the number of items resulting from the split.
[Input.Text] field, which provides the text value that needs to be divided into rows.
Set Index to 1 to reset the current split part to the first item.
Set ItemCount to the number of items resulting from the split function:
count(split([Input.Text], ';'))
.
Check if ItemCount is more than zero; this is important to avoid an endless loop when Index and ItemCount never meet.
Add or go to the row where current value needs to be saved.
Assign the current value to the correct field with the following function: count(split([Input.Text], ';'))(Misc.Index)
The (Misc.Index) chooses the split part that needs to be assigned.
Add 1 to the Index to process the next item;
Check if the Index is less than or equal to the ItemCount:
[Misc.Index] <= [Misc.ItemCount]
When ItemCount is less then the index the decision node results in true and goes back to the add or go to row node to repeat the loop.
When Index is greater than ItemCount, all split items are added, and you can leave the loop to save your changes and exit the flow.
Learn how to realize specific functionality in your WEM application, get tips & tricks from the pro's and learn how to deal with lists, widgets, ontology, integration, and more.
The WEM Modeler can be used to create any application you need.
To achieve good results, it helps to first know how the Modeler works. And it helps even more if you can learn how to do certain things, how to model specific functionality, how to deal with lists, widgets, integration, etc.
This section is dedicated to help you with all these things and more. Together with our WEM Partners we will keep adding new tips and tricks, and post updates on the Forum (tip: subscribe there to receive updates in your e-mail).
We have categorized tips and tricks in following groups:
A .txt
file is one of the most basic file formats for storing text. Extracting text from a .txt
file is straightforward because it contains plain text without formatting. Unlike extracting text from a Word or PDF file, extracting from .txt
can be done with an expression instead of a process node.
The following expression will extract the text from the file:
In the above example, [Input.Files.File01]
represents a text file. This file is first encoded as Base64 text and then converted into a text string usable in the application.
In the data model, we have a list where we can store files for use in the application. This list holds two key fields: one field stores the actual .txt
file, and the other is a calculated field that contains the extracted text.
The calculated field uses the following expression to extract the text from the file in the same record:
The next image shows you a basic interaction node that allows users to upload a .txt
file and display its content. After uploading a .txt
file a record with a text file is added to the database. A repeater is used to show the file on the left and the text content of the file on the right for each of the uploaded files.
The result looks like this:
You can also extract text from .docx
and .pdf
files using the 'Extract Text from document' process node. You can read more about that process here: Extract Text from Document.
Arrow keys | Standard cursor navigation. |
Enter | Create a new richtext element within current active container (creating a standard container in which you can type text) and enable Text Typing mode (see next section). |
Backspace | Remove (selected) element(s). |
Delete | Remove (selected) element(s). |
Tab | Select the first child element of current selected element. |
Shift + tab | Select the parent element of current selected element. |
Alt + Arrow keys | Move element(s) in direction of arrow (when applicable). |
Shift + Arrow keys | Expand selection in direction of arrow (when applicable). |
Ctrl + A | Smart select all (repeat to expand selection outward). |
Ctrl + C | Copy element(s). |
Ctrl + X | Cut element(s). |
Ctrl + V | Paste element(s). |
Ctrl + Z | Undo last action (repeatable) |
Ctrl + Shift + Z | Redo last action (repeatable) |
Ctrl + Y | Redo last action (repeatable) |
|
|
Any other | Type anywhere to create a Button, Datagrid column, Richtext, etc based on the context of the cursor (within a button bar, within a datagrid, within any other container that default contains a text-element respectably). |
Arrow keys | Standard cursor navigation. |
F1 |
F2 | Rename element. |
Delete | Remove (selected) element(s). |
Ctrl+Up | [Concepts and Navigation items] Move item up 1 place (within current folder or parent item) |
Ctrl+Down | [Concepts and Navigation items] Move item down 1 place (within current folder or parent item) |
Show specific page in online documentation ()
The hosting of videos in your projects is not something we support, as hosting videos generate significant data traffic, which can strain network resources. Hosting videos also requires substantial storage space adding load to server infrastructure and SQL databases are not optimized for video hosting.
As a solution we advice to use embedded videos in interaction screens. Embedding Iframes is supported by most major hosting providers and allows you to display access-protected videos.
Finding the src URL can sometimes be a little tricky, but with most hosting sites it can be found as part of the embed script. In the example below you see the script Microsoft stream returns when selecting share -> embed code, where src="VideoURL"
.
When you use private videos or videos hosted behind a login you can use the authentication node to force a user to first log the session into the hosting provider and allow the user to see the video. Alternatively with videos hosted in Microsoft stream a user can log into their Microsoft account through the player without leaving the project.
Download the widget file attached at the bottom of this page, and add it to your work-space's widget library. To do this start by navigating to the Templates, Widget, Files tab in the resource pane and right click widgets to open the widget editor. Navigate to your current workspace and right-click to create a library and import the widget with another right-click on the library you just made. Browse to the downloaded zip file and confirm the widget is now added to the library and can be made available for use in your project.
Property | Datatype | Description |
---|---|---|
Source
Dropdown
Host or service where video is provided from. You can use the other option and provide a full embed "src" URL for providers not in the list.
Video ID
Text, Expression
The ID of the video, this is part of the video url. For most sites this is at the end of the url, for example:
https://www.youtube.com/watch?v={VideoID}
Video URL
Text, Expression
The source url of the video, this url should be an embed link source. Open the share menu end select embed, look for src="{the link}" For example: https://www.youtube/embed/{videoID} https://www.player.vimeo.com/video/{videoID}
Allow Fullscreen
Boolean, Toggle
Enable or disable the fullscreen option in the player.
Width
Number
Width of the videoplayer block in pixels. The aspect ration of the video is kept intact.
Height
Number
Height of the video player in pixels. The aspect ration of the video is kept intact.