Conditional formula or other solution SharePoint - sharepoint

I have a SharePoint list that has a checkbox field with 21 answer options. The user could select anywhere from 1 to 21 of those answers. I need to figure out a way for SharePoint to require an accompanying question and drop down answer for each orginal checkbox selected.
For example:
Field Name: Color
Checkbox Selections: Green, Blue, Red, Yellow, Pink, Purple
Selection Was/Boxes Checked next to: Green, Blue, and Pink
I then need SharePoint to ask the additional question of: Color Shade: Light, Dark, Really Dark, Neon in another checkbox option.
I think that I will have to have fields such as Green Color Shade, Blue Color Shade, etc, but I only want those fields to show in the form if the color is selected in the original question.
Thank you in advance for any help and open to other solutions for the same result.

We can show/hide the field using jQuery code, add some jQuery code into new/edit form page to achieve it.
Example:
<script src="//code.jquery.com/jquery-3.3.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
HideOrShowFields($("h3.ms-standardheader:contains('Color Checkbox Selections')").closest("tr").find("select").val());
$("h3.ms-standardheader:contains('Color Checkbox Selections')").closest("tr").find("select").change(function(){
HideOrShowFields($(this).val());
});
});
function HideOrShowFields(value){
var array=["Green","Blue","Red"];
for(var i=0;i<array.length;i++){
if(array[i]==value){
$("h3.ms-standardheader:contains('"+array[i]+" Color Shade')").closest("tr").show();
}else{
$("h3.ms-standardheader:contains('"+array[i]+" Color Shade')").closest("tr").hide();
}
}
}
</script>

Related

Tabulator 4.9, is there a way to have 2 different colors of text within a cell?

The requirements from the customer state that a record's Comment and Description fields must be displayed in the same cell but the text of the Comment must be displayed in red while the Description should be black. Using a mutator, I can combine the 2 fields and display them in one cell, but I haven't seen how to make one have red text and the other black text within that cell.
Is there a way?
Thanks,
Matt
I wouldnt bother doing that, just use a Customer Formatter function
formatter:function(cell, formatterParams, onRendered){
return '<span style=color:red>' + cell.getRow().getData().Comment + '</span><P><span style=color:black>' + cell.getRow().getData().Description + '</span></p>';
}

Kendo Angular Chart Legend Colors

I have a Kendo for Angular column chart where we change the colors. The colors of the bars changed, but the Legend is still showing the default colors. Anybody know what Im missing?
https://stackblitz.com/edit/angular-8smzaw
The colours in the legend correspond to the colours of the series. Setting the colours of each column does not change the series. You need to remove the color settings and set the series instead.
Your template definitions should look something like this:
<kendo-chart [seriesColors]="['#4F81BD', '#C0504D']">
<kendo-chart-legend position="top"></kendo-chart-legend>
<kendo-chart-axis-defaults>
<kendo-chart-axis-defaults-labels format="c0"></kendo-chart-axis-defaults-labels>
</kendo-chart-axis-defaults>
<kendo-chart-tooltip format="{0:C}"></kendo-chart-tooltip>
<kendo-chart-series>
<kendo-chart-series-item
*ngFor="let item of detailSeries"
[data]="item.items" [name]="item.value"
field="value" categoryField="service"
type="column">
</kendo-chart-series-item>
</kendo-chart-series>
<kendo-chart-category-axis>
<kendo-chart-category-axis-item>
<kendo-chart-category-axis-item-labels [rotation]="-45"></kendo-chart-category-axis-item-labels>
</kendo-chart-category-axis-item>
</kendo-chart-category-axis>
</kendo-chart>

Gravity form Change value of quantity based on previous field selection

Hi I am using Gravity Form, and I am trying to build a form where depending on the service you choose, the quantity of hours will update automatically. For example:
Multiple choice field: 1. Wash a car 2. wash a truck 3. wash a motorbike
Quantity field should pre-populate with either; 1 (if motorbike is selected, or 2 (if car is selected or 3 (if truck is selected)
Any help is much appreciated
A generous developer I know helped me out. Add this code after the form. here is the answer:
<script type="text/javascript">
var helpSelect = document.querySelector('#input_2_22')
var quantityInput = document.querySelector('#input_2_28')
helpSelect.addEventListener('change', function (e) {
quantityInput.value = e.target.value
})
</script>
Remember to change the input id to the id of the input in your form.

Conditional row coloring in PowerBuilder 10.5

I'm using Power Builder 10.5 and I'm having a problem that seems simple at first, but can't get near the solution.
Is it possible to color rows differently depending on a condition? I have a select statement that retrieves numerous rows, that have different status: status A means the row is active, ERR that something is wrong, F that is finished, and so on...
What I need is the color of the column with status "ERR" to be red, and the color of the column with status "A" to be green. All else columns may be white.
I can do only half the job at the moment. I've added a dummy field in my Data Window, called "color". For all the cells I've written this in the design view, background color properties..
IF ( color =1, 65280, 16777215)
Now I move to the clicked event of my OK button where I retrieve data...
dw_1.Retrieve()
FOR ll_=1 to dw_1.RowCount()
ls_status=dw_1.GetItemString(ll_,"status")
IF ls_status='A' THEN
dw_1.SetItem(ll_, 'color', 1)
ELSEIF ls_status='ERR' THEN
??????
END IF
NEXT
The part with question marks is where I can't move forward. This highlights all my rows where status is "OK" green, but I can't seem to get the error ones red. I've tried manipulating the code in background color properties (trying to give him a condition if color=2), but I just keep getting the "Expression not valid" message.
Modify method also didn't help me much, as I can't seem to make him color only does rows with "ERR" status using Modify method.
Any advice will help.
You should set your 'color' column in the SQL statement itself.
SQL something like
CASE status WHEN 'ERR' THEN 'R' WHEN 'A' THEN 'G' END
Then in an expression on the background color of the columns of your datawindow you can put something like
if (color[0] = 'R', RGB(255,0,0), if (color[0] = 'G', RGB(0,255,0), RGB(0,0,0)))
In the datawindow properties of the object or band, go to the background tab. The Color property has a little button with an equal sign (=) on it. Click that and write an expression to derive a RGB value based on the value of a column.
I wrote an article about this stuff here: PBDJ Article
You can use case statements in the computed property. Something like this:
case( status when 'ERR' then RGB(255,0,0) when 'A' then RGB(0,255,0) else RGB(0,0,0) )

SSRS pie chart color coding

I have an ssrs report where I have many pie charts with the fields pass and fail as well as up to 3 other miscellaneous fields and I wish to be able to color the pass always green and the fail always red but the other fields could be a default value. Is this even possible to do? I have seen code examples with code for custom color in pie charts but I have no clue how to do this and have not found where I would put my custom code. What im trying to do is slightly different from what all those other examples do whith only defining a few fields.
=Switch
(
Fields!ResultTypeDescription.Value = "Pass", "Green",
Fields!ResultTypeDescription.Value = "Fail", "Red",
Fields!ResultTypeDescription.Value = "Assigned To Machine", "Blue",
Fields!ResultTypeDescription.Value = "Not Yet Assigned", "Orange",
True , "Gray"
)
In order to get our dynamic coloring working,i overrode the colors from the palette. This is how it’s done. Right-click on the pie and select Series Properties. Select the Fill page and click the Expression (fx) button to define the color.

Resources