Today I will try to make step by step a simple voting system based on WEBCON BPS Modern form.
I am using WEBOCN BPS Express Standalone (“SharePointless”) installation. The used version is 2019.1.4.23.
Goal
The goal is to make a simple system, where each user may vote in a given workflow element. It may be an Idea of something, company trip destination and so on. Any user may vote for a plus or vote for a minus. Voting should be anonymous. There should be only the score result, without information who voted. The user should be able to take 4 actions:
- PLUS Vote button – add point and cancel voting on minus if this user voted on minus before
- Retract PLUS button – this action should be visible only if the user voted on plus. On click, one point is retracted
- MINUS Vote button – retract point and cancel voting on plus if this user voted on plus before
- Retract MINUS button – this action should be visible only if the user voted on minus. On click one point is added
Implementation
Firstly I created two “Multiple lines of text” form fields. In these fields, I am going to store users who voted on particular options. Users will be separated by a semicolon.
Then I created 4 buttons on the step, where voting should be available. If voting should be able on multiple steps, you may consider configuring actions on
Let’s check how it looks at this point:
As we see above there are some things we can do to make this functionality
- There is
needed form field storing score result - Button visibility should be depended on workflow element state
Firstly let’s add integer value form field named “SCORE”. Then it is necessary to add another action that will calculate points. I used the table-valued function dbo. splitToTable which is installed with WEBCON on content database.
This action should be added to every button. Next, I added visibility restriction on buttons. The configuration is listed below.
Let’s check how the form looks now. Screenshots below are tested on Kamil.Nedza account. Looks that everything is working properly. When
Okay – we are almost done. Let’s polish this form a bit.
- Hide [TECH] form fields on field matrix – we do not want to give information who voted and how
- Add style on score attribute – make the score more visible
- Add fancy icons and delete buttons names – icons are more ergonomic. Icons need to be added to the BPS Portal folder location. In my case I added them at: C:\Program Files (x86)\WEBCON\WEBCON BPS Portal\wwwroot\images
- Make redirection action to view mode – default form is in edit mode and the user will blocking other users to vote. Just redirect him to view mode instead.
Summary
That’s all. Now we have got fully implemented simple voting system in our workflow. In my case form looks like below. When the user did not vote yet, he has 2 black buttons. When he voted on a given option, the retract button is colored.
Featured image: Designed by Freepik