Qualtrics trigger message - custom formatting - conditional-formatting

Good morning everyone,
I have been creating a survey in Qualtrics and configured the mail message going out after each submission. I have the following code inside the body of the text. The last field (CODE) retrieves from the variables a numeric value = 0 or 1. I would need to format one of the lines in the message (for example SELECTED) with a green text colour if CODE=1 and red text color if CODE=0.
SCORE: ${gr://SC_8wExY0SJDXfJ2UC/Score}<br />
DOMANDA: ${q://QID8/QuestionText}<br />
TUTTE RISPOSTE : ${q://QID8/ChoiceGroup/DisplayedChoices}<br />
SELECTED: ${q://QID8/ChoiceGroup/SelectedChoices}<br />
UNSELECTED: ${q://QID8/ChoiceGroup/UnselectedChoices}<br />
RECODE: ${q://QID8/SelectedChoicesRecode}<br />
CODE: ${gr://SC_cIIBMpIqBI6Jlpc/Score}<br />
Can you help me?
Thank you very much.
Kind regards, Stefano

You need to assign an embedded data field equal to score in the survey flow, then set a color based on that field:
code = ${gr://SC_cIIBMpIqBI6Jlpc/Score}
color = red
If code Greater than 0
color = green
Then add html to your email text:
<span style='color:${e://Field/color}'>
SELECTED: ${q://QID8/ChoiceGroup/SelectedChoices}<br />
</span>

Related

cant find an element with selenium by a specific text the element contains, when i want to search for it by the specific text + a variable

I wanted to find an element by a specific text it contains. That worked well, but here is the problem.
There are multiple elements, all with a specific text that Contains "EU" and a Number...
For example: "EU 40" or "EU 30". Now I want to replace the Number by an variable, so that I can decide what number the specific text should contain.
Just let me show you my code:
real_size_btn = browser.find_element_by_xpath("//button[text()='EU 40']")
real_size_btn.click()
This code is working, but what does not work is this code:
size = input("size:")
real_size_btn = browser.find_element_by_xpath("//button[text()='EU "+size+"']")
real_size_btn.click()
Every time I run the second code it says: "no such element: Unable to locate element: {"method":"xpath","selector":"//button[text()='EU 41']"}"
Hopefully somebody can solve this Problem, I would appreciate it a lot.
A little edit:
This is the main element:
EU 40
Above the main element is this element:
<input aria-describedby="pdp-buytools-low-inventory-messaging" id="skuAndSize__26126342" name="skuAndSize" type="radio" class="visually-hidden" value="26126342:7">
And under the main element are pretty much the same elements, but a little bit different because the other elements are other shoe sizes.
For example this is an element of an other shoe size:
<label for="skuAndSize__26126330" tabindex="-1" class="css-xf3ahq">EU 39</label>
above this element is this:
<input aria-describedby="pdp-buytools-low-inventory-messaging" id="skuAndSize__26126330" name="skuAndSize" type="radio" class="visually-hidden" value="26126330:6.5">
Hope that helps.
can you try this
real_size_btn = browser.find_element_by_xpath("//button[contains(.,'EU "+size+"')])";
Why don't you use f-strings?
some_number = "your number"
real_size_btn = browser.find_element_by_xpath(f"//button[text()='EU {some_number}']")
Furhermore,
You can put your numbers to a list like this:
your_list = [10, 20, 30, 40, 50]
and access them as your_list[0], your_list[1] and so on.

How to change input type of sap.ui.input control. I have done as per documentation but it is not reflecting in view

I want to change input type from password to text.
What i have done:
1) In xml view:
<input type="Password" id="idPassword" showValueHelp="true" /> // enabling showValueHelp a button right corner in input text
2) In controller :
var oInput = this.getView().byId("idPassword");
oInput.attachValueHelpRequest(function(){
oInput.type = "Text"; //change input type as per documentation.
console.log(oInput); // I can see type="Text" in console
});
Actually It is not reflecting in browser.
There is not method called type.You should use
oInput.setType("Text");
or
oInput.setType(sap.m.InputType.Text);
Note:default type is Text.So you dont have to set it at all

autocomplete input show value even value is empty

I have input with autocomplete.
<input type="text" class="form-control input-sm isFieldValueEmpty tooltip"
style="width:779px;" id="searchK" name="keywords" value=''>
Everything works good, but I set value of autocomplete and after that add value from autocomplete to hidden input (user can choose many value from autocomplete). But when I add this value and try to set empty value of autocomplete input:
$("#searchK").attr("value","");
In input field still have text, but value od this input is empty (checking by firebug).
Any idea how delete this text?
I found solution
$(this).val('');
return false;
And input is clear.
Don't use attr() to change the value, use val()
$("#searchK").val("");

How to get the total number of pages in RML template?

There is a tag in RML, <pageNumber>, that displays the the current page number.
But how can I get the total number of pages of the generated PDF document?
I would like to add a pagination with something like "Page 1/2", "Page 2/2":
Page <pageNumber /> / <pageCount>
But the <pageCount> tag doesn't exist.
After spending a considerable amount of time, I found this:
At the end of the <story>, add:
<namedString id="lastPage"><pageNumber/></namedString>
To display pagination, use:
Page <pageNumber /> / <getName id="lastPage" default="0" />
I´ve been working in a solution for this case in OpenErp:
<document>
<template>
<pageTemplate>
<stylesheet>
...
<paraStyle name="main_footer" fontSize="7.0" leading="7" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
...
</stylesheet>
...
...
<!-- Page Footer -->
<place x="1.5cm" y="0cm" height="1cm" width="19.0cm">
<para style="main_footer">[[ o.name or '']] | Página: <pageNumber/> de </para>
</place>
<drawString x="4.9cm" y="0.74cm"><pageCount/></drawString>
...
Basically, it "draws" the <pageCount> tag at the left of my footer text. The solution from #alartur is more elegant but it does´t work in the OpenErp rmltopdf converter.
We must use Helvetica font at 7px for our footer text because is the default font used in the rmltopdf code for <pageCount>

How do I submit data with Dojo DateTextBox after selecting a date

I'm trying to make a DateTextBox that submits data once a date is selected. To do that I have this code: <form action="timecard/setViewDate" method="post" id="timespan" dojoType="dijit.form.Form">
<input type="text" name="calendar" value="2009-09-28" id="calendar" dojoType="dijit.form.DateTextBox" onchange="doTimechangeSubmit" />
</form> and the onchange function is: function doTimechangeSubmit()
{
var thisdialog = new dijit.Dialog({ title: "Please Wait...", content: "We are wasting some time.", id: 'stupidWasteOfTime'});
dojo.body().appendChild(thisdialog.domNode);
thisdialog.startup();
thisdialog.show();
setTimeout("dojo.byId('timespan').submit();",1000);
dojo.byId('timespan').submit();
}
I have this function because without waiting a bit the value I receive is the date the widget starts with. I hate this and I'm just waiting for a slow response to break it.
My want is to hook the submit function in a place that guarantees I get the value the user actually selected. Anybody have any ideas?
This is fixed in Dojo 1.4. Refer to ticket #9566.
Change dojo.byId('timespan').submit(); to dijit.byId('timespan').submit();
For an explanation read this.