Quantcast
Channel: Jan von Reith – HanseVision Blog
Viewing all 24 articles
Browse latest View live

Nintex Workflow for Office 365 – How to get the corresponding values of a lookup column value

$
0
0

In my scenario, I have two lists. The first list is called „Car marks and Product locations“, where I store car marks and the locations where they are produced.

image

The second list is called „Car marks“, there I can create entries and choose between different car marks via a lookup column on my first list. The corresponding locations for the chosen car marks should automatically be stored in an additional column called „Product locations“.

image

The workflow that identifies the corresponding values looks like this:

First I use a „Set variable“ action to get the ID’s of the values that have been chosen in the lookup column „Car marks“ and store them in a variable called „varCarMarksLookupIDs“.

image

At this point it’s important to mention that I choose „Lookup IDs, Comma Delimited“ as the format for the values I store in the variable.

image

Then I use a „Regular expression“ action to split the single IDs and put them into a collection variable called „vCarMarksLookupIDsCollection“.

image

Now I’m using a „For each“ action to iterate through all ID’s that have been stored in the collection. The current ID always gets stored in a variable called „vCarMarkSingleLookupID“.

image

In the first step of the „For each“ action I get the product locations for the current car mark ID and store them in a variable called „vCarMarkProductLocations“ with the help of a „Set variable“ action.

image

In the second step of the „For each“ action I build a continuous string of all product locations with the help of the „Build string“ action.

The variable „vCarMarksProductLocationsAll“ contains all product locations. For every loop, I add the corresponding product locations for the current ID to that string.

clip_image016

At the end of the „For each“ action I have all corresponding product locations for every car mark in my string variable and can now update the item with it.

image

This is how the whole workflow looks at the end:

clip_image019

And this is the result after the run of the workflow:

image


Step-by-step guide – How to build a dynamic repeating section with Nintex Forms for order forms

$
0
0

In this blog post I’d like to provide a step-by-step guide to build a dynamic repeating section with Nintex Forms that can be used in order forms for example. Furthermore this guide will include a solution to check the total price of an order against a predefined budget. The focus of the whole solution will be on the Calculated Value control, the Lookup function, Runtime functions and Rules. I’ve created this guide by using Nintex Forms 2016 (On-Premises), but it should also work for Nintex Forms 2013 (On-Premises).

In the repeating section the user will be able to choose from a specified list of products, whereby the price of the product, the overall price based on the desired amount and a picture of the product will be shown. At the end of the form the user will see the overall price of all products and furthermore will get an information whether she or he is still in the defined budget or not.

At the end the form will look like this (Display mode):

Creation and configuration of the needed lists

First create a list to store the single products, this list should be called „Products“ and it should look like this:

Name = Single line of text
Price =  Currency
Picture = Multiples lines or text (Plain text)

Add another list called „Product orders“, in this list the orders will be created and saved. The list looks like this:

Title = Single line of text
Total price of order =  Currency
Order = Multiples lines or text (Plain text)

In a real world scenario there would probably be more columns to store additional information, like information regarding the customer/user.

General settings and configuration of budget definition

Start to edit the form in the „Product orders“ list with Nintex Forms. Remove all controls that are not needed, change the background color to white (#FFFFFF) and change the grid cell height and weight to 20 pixel.

Add a „Label control“ at the top of the form and insert „How much money do you want to spend?“. Furthermore add a „Single Line Textbox“ control right next to it. Name it „Budget“, change the default value to „0.00“ and set the data type to „Currency“.

Configuration of the repeating section

This is how the repeating section should look like at the end:

First add a „Repeating section“ control. Name it „Order“, connect it to the „Order“ column in the list and change the „Text for add row icon“ to „Add additional product“.

Add a „Label control“ and insert „Position“. Furthermore add a „Calculated Value“ control below. Name it „Position“, in the „Formula“ section add the following runtime function currentRowNumber().

Add a „Label control“ and insert „Product“. Furthermore add a „List Lookup“ control below. Name it „Product“ and configure it in the way that it displays all items that are stored in the „Products“ list.

Add a „Label control“ and insert „Amount“. Add a „Single Line Textbox“ control below. Name it „Amount“, change the default value to „0“ and set the data type to „Integer“.

Add a „Label control“ and insert „Product Price“. Furthermore add a „Calculated Value“ control below. Name it „ProductPrice“, in the „Formula“ section add the following runtime function lookup(„Products“,“ID“,Product,“Price“). This function will display the price (List „Products“ –> Column „Price“) of the chosen product in the „Product“ control. Set the „Save as data type“ to „Currency“ and the „Value prefix“ to „$“.

More information regarding the Lookup function can be found here: https://techrhodes.wordpress.com/2016/10/13/using-the-lookup-function-in-nintex-forms/

Add a „Label control“ and insert „Total Price“. Furthermore add a „Calculated Value“ control below. Name it „PriceTotal“, in the „Formula“ section add the following formula ProductPrice*Amount. Set the „Save as data type“ to „Currency“ and the „Value prefix“ to „$“.

Add a „Calculated Value“ control and name it „Picture“. In the „Formula“ section add the following runtime function lookup(„Products“,“ID“,Product,“Picture“). This function will display the picture (List „Products“ –> Column „Picture“) of the chosen product in the „Product“ control.

Configuration of budget check

Add a „Label control“ and insert „Total price of your order“. Furthermore add a „Calculated Value“ control right next to it. Name it „OverallPrice“, in the „Formula“ section add the runtime function sum(PriceTotal). The „sum“ runtime function returns the result of all the values in a set being added together. Set the „Save as data type“ to „Currency“ and the „Value prefix“ to „$“.

Add another „Calculated Value“ control right next to the „OverallPrice“ control, name it „BudgetCheck“, in the „Formula“ section add the following runtime function If(OverallPrice>Budget,“You spend too much“, „You do not spend too much“).

If the defined overall price of the order in the „OverallPrice“ control is greater then the budget in the „Budget“ control, the calculated value will be „You spend too much“, if this is not the case it will be „You do not spend too much“.

To highlight the result add two rules on the „OverallPrice“ control and configure them like that:

 

After a little bit of formating the whole form should look like this at the end:

Of course there are many more things that could or must be done to get a perfect order form, like adding validation rules (i.e. if the overall price is greater then the budget) but I hope this gives you a good starting point and has provided you some tips on how to implement your requirements regarding such a form. Maybe I’ll add some more features in the future 😉

If you have any questions, found an error or have a better way to accomplish this, feel free to contact me! 🙂

Nintex Forms – Automatically calculate distance between two cities with the Web Request Control and the Google Distance Matrix API

$
0
0

In this blog post I’d like to show, how to use the Nintex Forms “Web Request” control together with the Google Distance Matrix API to automatically calculate the distance between two cities and the estimated duration for that trip.

At the end the form will look like this (Edit mode):

image

Setup Google Distance Matrix API

Before the implementation of the SharePoint list and the Nintex form, some simple steps need to be performed, to be able to use the Google Distance Matrix API. The documentation of the Distance Matrix API can be found here: https://developers.google.com/maps/documentation/distance-matrix/intro?hl=en

The most important point is the generation of necessary API key, the process for this is described in the “Get a key” section of the documentation:

image

After reading the documentation I configured the following request:

https://maps.googleapis.com/maps/api/distancematrix/xml?origins=Hamburg+22763&destinations=Muenchen+80331&mode=driving&language=de-DE&key=************************

In this request, there can be found the departure value (“Hamburg”) with the corresponding departure zip code value (“22763”) and the destination value (“Muenchen”) with the corresponding destination zip code value (“80331”). Furthermore, the mode is set to “driving” and the language is configured to be German (“de”). At the end of the request there’s the necessary API key.

Please be aware that you need your own API key! The URL provided in this blog post won’t work for you!

The result of this call looks like this:

<DistanceMatrixResponse>
    <status>OK</status>
    <origin_address>22763 Hamburg, Deutschland</origin_address>
    <destination_address>80331 München, Deutschland</destination_address>
    <row>
        <element>
            <status>OK</status>
            <duration>
            <value>26400</value>
            <text>7 Stunden, 20 Minuten</text>
            </duration>
            <distance>
            <value>797062</value>
            <text>797 km</text>
            </distance>
        </element>
    </row>
</DistanceMatrixResponse>

Creation and configuration of the needed list

For this scenario, I set up a simple custom list called “Driver’s logbook” and added the following columns:

image

Configuration and implementation of the Nintex form

Then I started to configure the Nintex form. As always, I first made some basic changes and adjustments like changing the background colour, the grid cell size and the logo. Furthermore, I removed some control that I didn’t need, like the “Distance” and the “Duration” control.

Afterwards my form looked like this:

image

Then I added two “Web Request” controls into the blank areas in my form:

image

Then I started with the configuration of the control that should show the distance, at the end the configuration looked like this. These are all the settings that I changed

Name = Distance
Text connected to = Distance
Display format = Text
Service URL = https://maps.googleapis.com/maps/api/distancematrix/xml?origins=Departure+Departurezipcode&destinations=Destination+Destinationzipcode&mode=driving&language=de-DE&key=************************
XPath for display = //row/element/distance/text
Execute in view mode = Yes

image

Afterwards I configured the control that should show the duration, at the end the configuration looked like this. These are all the settings that I changed:

Name = Duration
Text connected to = Duration
Display format = Text
Service URL = https://maps.googleapis.com/maps/api/distancematrix/xml?origins=Departure+Departurezipcode&destinations=Destination+Destinationzipcode&mode=driving&language=de-DE&key=************************
XPath for display = //row/element/duration/text
Execute in view mode = Yes

image

So, that’s the final configuration of my form:

image

When I now fill out the form and enter a destination the distance and the duration will automatically be calculated. To get a better result I decided to also add the destination zip code and made it mandatory, as in some cases cities also have the same name.

image

For this example, it doesn’t make a big difference (2 minutes and 8 km).

image

If you have any questions, found an error or have a better way to accomplish this, feel free to contact me!

Nintex Forms for Office 365: Responsive Form – Set Field Value Rule

$
0
0

Some days ago, Nintex released a new feature for Forms in Office 365, the so called „Responsive Form“, which now coexists with the good old „Classic Form“. With the help of this feature users can create powerful responsive forms that directly work on PC’s, smartphones and tablets without more effort or further configuration like in the „Classic Form“ experience. More information can be found in the Nintex blog: https://www.nintex.com/blog/new-nintex-responsive-forms-faster-design-experience-faster-results/

This blog post is not about the responsive design features that come with the „Responsive Form“, it’s about another new feature that has been introduced, the new rule type „Set value“. I want to show you how you can use the rule type to automatically set the phone number of a chosen Department.

Scenario

I created a custom list called „DepartmentsPhoneNumbers“. The list contains out of two columns („Department“, „Phone number“). In this list, I created three entries:

Furthermore, I created another custom list called „Elements“. The list contains out of three columns („Title“, „Department“, „Phone number“).

Implementation and configuration of the responsive form

After the creation of these lists I started with the creation of my responsive form in the “Elements” list.

As the new rule type ”Set value” is only available in the “Responsive Form” experience I chose the “Responsive Form” designer.

This is how the form looked at the beginning:

First, I deleted the „Department“ control and added a „List Lookup“ control. I configured the control to show all available departments out of my „DepartmentsPhoneNumbers“ list. There’s no difference in the configuration between the “Responsive Design” and the “Classic Design”.

This has been the final configuration of the control:

Furthermore, I’ve made some simple changes, like changing the colour of the theme and changing the arrangement of the controls. Both steps have been very simple and everything worked without any problems!

Then I started with the creation of my rule. Therefore, I marked the „Phone number“ control and clicked on „Add rule“ in the ribbon.

The configuration of the rules feels a little bit different, but actually it’s the same as in the Classic Design. I named my rule „GetPhoneNumber“ and the rule should fire when the „Department“ control isn’t empty anymore.

In the „Then“ section I then choose „Set value“, the new rule type that has been shipped with the new responsive design.

I configured the value section to set the value based on a lookup. The lookup function gets the phone number according to the chosen department. At the end, I published the form.

When I now create a new element in the list and choose a department, like „Consulting“, the corresponding phone number gets written into the phone number control.

The most important point about this is the fact, that I can now work the value, i.e. I can delete or change it. In the “Classic Form” experience this was only possible with the help of additional JavaScript.

Viewing all 24 articles
Browse latest View live