SharePoint Json formatting - json

Hopefully someone can shed some light on an issue I am having, I have 3 columns in a SharePoint list. One is the number of days for a task to be completed (i.e 5) the second is the calculated date (i.e todays date + 5) the third displays a count down of days. I have tried formatting this column with JSON with no success. What I would like to do is have the text or background green for 4 and 5 days yellow for 3 and 2 days and red for 1 day.
This is the JSON that forms the count down column, for the formatting I tried to use indexof to find 1 day(s) but that didn't work? maybe because the actual value is displayed as a date?
Hopefully this makes sense? and I hope I have not missed something glaringly obvious?
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "=floor((Number(#currentField)-Number(Date((getMonth(#now)+1)+'.'+getDate(#now)+'.'+getYear(#now))))/(606024*1000))+' day(s) remaining'"
}

To achieve dynamic countdown column, you need to integrate your list with power automate flow. Column formatted using JSON won't refresh the value every day and it is a static value only if when there is a refresh item action.
See this thread: Create Dynamic Countdown in SharePoint List items.

Related

How to break new line on Microsoft Sharepoint list column description?

Not sure if this is a good place to ask but I’m about an hour into editing a Sharepoint for the first time, have zero prior knowledge on creating/editing Sharepoints, and I’m stuck trying to figure out how to wrap text to a new line in the description field of a particular column on my list.
We need the submitters to stop at a certain point and not touch the remaining fields, and the only way I can figure out how to do that is by adding a column description that tells them to stop. I want the description of that column to read as:
————-—STOP ————-—
Submitters stop here. Do not use the fields below, unless attaching images/files. The remaining fields are for macro champ use only.
———————————————-
Instead of :
————-—STOP ————-—Submitters stop here. Do not use the fields below, unless attaching images/files. The remaining fields are for macro champ use only.———————————————-
Do I need to use JSON to achieve this? If so..what is the code I would need to use?
Also open to alternative solutions to create a line/stop/hide fields from them or something.
——————
ETA - photo of what my column formatting box looks like.
——————
ETA for further clarification -
The column in particular that I am trying to add the “stop” message to is actually named “Attachments included?” And has ‘yes’ or ‘no’ radio choice buttons. Then the description underneath that column says “submitters stop here, unless attaching images/files below.” This column, and it’s description, are hidden from the list overview and only visible when submitting a +New item.
The reason for doing this is because we have a handful of fields towards the end of the +New item submission form that we don’t want submitters to touch, as they are for the help desk agents to fill out only.
I don’t see any other way to add a stop/line or hide certain fields from the submitters (while still leaving them visible to the help desk team), so just trying to make this “stop” description look a little neater.
Format the column as shown below:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": " ————-—STOP ————-— \n\n Submitters stop here. Do not use the fields below, unless attaching images/files. The remaining fields are for macro champ use only. \n\n ———————————————",
"style": {
"width": "100%",
"font-weight": "bold"
}
}
Update:

passing cascade dropdown value to Gallery on next screen, PowerApps

I'm doing POC on PowerApps and need help and advice
I connect my app to Excel as data source, ~ 800 records. I intend to pass these cascade dropdown value to my next screen in order to filter my Gallery displaying bunch of data. But I got no value in my Gallery.
Then i continue my experiment to test passing value with Label. I formulate my Next button in passing ONE dropdown value to next screen -- Navigate(Scr_Result,ScreenTransition.Cover,{selectedSite: drop_assetsite.Selected.Result --, i successfully get that value. But when I combine those 3 dropdown value on my NAVIGATE function, i got FALSE on my label text instead
Here is my NEXT navigate formula --- Navigate(Scr_Result,ScreenTransition.Cover,{selectedSite: drop_assetsite.Selected.Result And drop_building.Selected.Result And drop_assetcategory.Selected.Result}) But i found no red X mark on my NEXT button.
I'm not quite sure that I can combine those cascade value in one argument on Navigate or not. I can't find this combination somewhere. Thanks in advance for all replied. ^_^ and sorry for my poor English
You can use an expression like this one:
Navigate(
Scr_Result,
ScreenTransition.Cover,
{
selectedSite: drop_assetsite.Selected.Result,
selectedBuilding: drop_building.Selected.Result,
selectedCategory: drop_assetcategory.Selected.Result
})
And in Scr_Result you can access the three values (selectedSite, selectedBuilding, selectedCategory) in any expressions on that screen.

SSRS Showing a textbox when a second page is displayed

I am creating an Invoice in SSRS and I need to be able to show a textbox with "Balance Brought Forward" in if the amount of lines in the invoice goes over one page limit. So if i restrict the page to 5 lines and there is 10 - 15 lines which will equate to 2 or 3 pages, I need to be able to show this value from the previous pages total on invoice, but only on the 2nd and 3rd pages not on the 1st page. I am able to code in VB if that is the best way to do it, I am just really stuck on how I would achieve this.
Should this be done before generating the report in SQL or can it be achieved in the report it's self?
Can you put that in a header row and hide it on page 1? Or add the textbox and toggle the hidden property based on the number of rows returned.
IIf ((calculate # rows) > 5, False, True)

SSRS - Replace the Chart

I have a question, want some assistance.
Q) My question is that i have a chart in which analyst assigned for many incidents and some analyst have 1 or two incident assigned. just because of this the bar chart looks ugly some time. So thats why i used a new chart to represent Min incident count. But i want there some creativeness, for which i want there a radio button or OnClick event ( I do not know how to use both these. When report runs by default it`ll show Max incidents count chart and when we used radio button it will show Min incidents count chart, on the same chart area no need of new area or on new page.
Kindly help me or refer me some links and with ideas. As i have searched many blogs but i didn`t get any big achievement.
Below is my Simplified query;
SELECT
Count(IncidentDimvw.Id)
,UserDimvw.FirstName AS Analyst
FROM
IncidentDimvw
FULL JOIN WorkItemDimvw
ON IncidentDimvw.EntityDimKey = WorkItemDimvw.EntityDimKey
JOIN WorkItemAssignedToUserFactvw
ON WorkItemDimvw.WorkItemDimKey = WorkItemAssignedToUserFactvw.WorkItemDimKey
JOIN UserDimvw
ON WorkItemAssignedToUserFactvw.WorkItemAssignedToUser_UserDimKey = UserDimvw.UserDimKey
WHERE
WorkItemAssignedToUserFactvw.DeletedDate IS NULL
GROUP BY
UserDimvw.FirstName
Having (Count(IncidentDimvw.Id) = (#Count))
Having Clause is right or wrong, i donot know.
I used the following expresion in series as you suggested.
=iif(Parameters!Count.Value, Max(Sum(Fields!ID.Value)), Min(Sum(Fields!ID.Value)))
Sample data is as folows;
Regards
Muhammad Ahsan
I can think of a couple of ways to approach this:
Dynamic expressions based on parameter
Say you have a simple DataSet like:
And also a boolean parameter called showMax.
We can create a simple bar graph based on this:
The most important thing to note is that Series value is expression-based:
In the above example the expression is:
=IIf(Parameters!showMax.Value
, Max(Fields!value.Value)
, Min(Fields!value.Value))
i.e. when showMax is true, report the Max values, otherwise report the min values.
In this case I've also updated the Axis title, Chart title, and Custom legend text to be expression-based:
Axis Title: =IIf(Parameters!showMax.Value, "Max", "Min")
Chart Title: =IIf(Parameters!showMax.Value, "Max per group", "Min per group")
Custom legend text: =IIf(Parameters!showMax.Value, "Max value", "Min value")
The chart behaviour changes based on what parameter is selected as required:
Set Visibility based on parameter
Another option is simply to have to charts and hide one depending on parameter selection.
For example, for the Max chart the Hidden property can be set to:
=Not(Parameters!showMax.Value)
Setting this property correctly for each report will mean only one is ever displayed to the user, i.e. it will look dynamic.
Either of these options should work; the first keeps the layout simple in the designer makes the chart more complex, the second makes the layout more complex but keeps the charts simple.
Hopefully one option will work for you.

How can i show labels on a single bar graph depecting its value in flex for column chart?

Please check this link
http://livedocs.adobe.com/flex/3/html/help.html?content=charts_displayingdata_07.html#332805
here the thing is it is showing labelposition on all 3 column chart(column series)
(from link.. jan :2000,feb:1000,march:1500)
but instead of showing in all months i want the value to be displayed only on march
how can i do it?
need help
Create an itemrenderer(Implement IDataRenderer), and in set data method, write the condition for March month.