Greetings,
Actually i want to create assessment sheet using the create form activity in the UiPath studio , where the user answer the questionnaire and each one of the options carries different marks . After the submission of the assessment , all the marks(user got by selecting different option) are added up for further purpose. The thing is i don’t know how to access allocate different mark for each options in Radio Component in create form activity and how to access those values for addition.
I saw many people solve their complicated issues in this forum. Please, somebody help me out.
Hi @swathi_sakthi ,
Is it possible for you to provide a Screenshot or the Form Design itself , so that we can get an Idea on what is to be done.
A visual representation would help us provide you in a faster way with better suggestions.
Let us know if you could provide us with screenshots of your Form Design or your Implementation till now.
hi @supermanPunch ,
Thank you for helping me.
Here, Sir
In this radio component the options “Better than usual and Same as usual” should carry 0 mark and the options “Worse than usual and Much more than usual” should carry 1 mark…
like this i have 28 questions, finally all the marks should added up
Please , help me that how to allocate the marks for every separate options and how to access those marks after the submit button is clicked.
Checking with the Design like below, when creating a Static group of radio buttons we can also assign the default values to them accordingly as needed. Check the below image :
We would also need to assign an Output variable for the FormFieldsOutputData
property like shown below :
We will then be able to use this output to perform our calculations :
-
Deserializing the output data from Forms, we get the Json Object.
-
Next, we use this Json Object to calculate the values selected in the radio buttons using the below Expression :
jObj.Properties.Where(Function(x)x.Name.Contains("radioButn")).Sum(function(x)CDbl(x.value))
Here, We are filtering based on the Field Key
names that was assigned in the Form Design, we keep the initial part of the names same so that we can filter it out and perform the calculation for it using the Expression above.
Let us know if you are not able to understand the above approach.
Thank you so much for your response, Sir.
I will try and let you know.
jObj.Properties.Where(Function(x)x.Name.Contains("radioButn")).Sum(function(x)CDbl(x.value))
Can i assign this to the another variable and use the variable to display the result of assessment ?
like if the total score is 4 means “okay” .
@swathi_sakthi ,
Yes. You can assign it to a Double type variable using the Assign
activity.
Then using if
Condition Activity, you should be able to compare the value.
Sir can you please explain how this code works?
i try this code by put it in the message box , but it only display 0 even i gave the option that carries 1 mark.
Could you let us know what is the Field Key
- Property Name
value that you have used in the Radio Component ?
Similarly, what have you used for other radio components ?
Also, You could Debug and check what is the output value that is being received after Form Submit.
i used Field key- property
value as q1,q2 to q28 since i have 28 radio component questions in it.
is it possible to used like this?
jObj.Properties.Where(Function(x)x.Name.Contains(“q1,q2,q3,q4,q5,q6,q7,q8,q9,q10,q11,q12,q13,q14,q15,q16,q17,q18,q19,q20,q21,q22,q23,q24,q25,q26,q27,q28”)).Sum(function(x)CDbl(x.value))
@swathi_sakthi ,
It is better to rename it with something unique and understandable even in a Short Form, For Example, it is a Radio Button, and hence you could name it as radioButton1, radioButton2, radioButton3 etc or in it’s short form rdB1, rdB2, rdB3. So that we can use it for our purpose of identifying these components and getting it’s related values. We also should note that we do not name it similar for other components, example If a Radio Component is present which you don’t want to calculate the values, then it’s Field Key should not contain rdB
.
Hope the above is understandable :
For this case, you could try with the below Expression :
jObj.Properties.Where(Function(x)x.Name.Contains("q")).Sum(function(x)CDbl(x.value))
If you change it to rdB1, rdB2, rdB3,… then you can try the below :
jObj.Properties.Where(Function(x)x.Name.Contains("rdB")).Sum(function(x)CDbl(x.value))
jObj.Properties.Where(Function(x)x.Name.Contains(“q”)).Sum(function(x)CDbl(x.value))
Woah!!!
It is working sir . Thank you so much!!
I have another confusion sir,
how to write the code when i want first 7 questions has some context that should be mentioned (like display as output) when the user get 2 or greater than 2 marks in first 7 question… like wise next 7 questions until final 7 question…
Could you explain it in a bit more detail ? If possible you could create another topic and explain your requirements for this in that post. If you do think that it would be a slight change/addition, you could continue your explanation in this post itself.
Do explain with screenshots or Steps if possible so that we would be able to get a clear idea.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.