Sharepoint list formating isssue - sharepoint

I have the problem that no matter what i do my formatting doesnt work.
my goal is that if ganztägig is true, only the date and the word ganztägig is thair and if ganztägig is false , only the date and the time is thair. I tried everything but its not working.
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "=if([$Ganztägig.displayValue]==TRUE,
(toLocaleDateString(#currentField)),
(toLocaleString(#currentField)))
"
}
enter image description here
enter image description here

Per my test, if your Ganztägig column is yes/no column type, you could just replace [$Ganztägig.displayValue] with [$Ganztägig], then you will achieve your goal:

If your Ganztägig column is of type "Yes/No" (Boolean), try using this JSON:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "=if([$Ganztägig],toLocaleDateString(#currentField),toLocaleString(#currentField))"
}
Note: Make sure you are using correct internal name of Ganztägig column in JSON.
Documentation: SharePoint column formatting

Related

How do you return a value within a 2D array in Azure Data Flows Open Expression Builder?

Background: I have a CSV file with a column that has a list of tags for a given row. The tag list is not in any specific order and varies for each cell in the tags column. I am looking for the value for a row which matches the string "Owner". When pulling in the CSV file, the entire cell is 1 string per cell. An example cell in this column looks like following:
"Organization": "Microsoft", "Owner": "Eric Holmes", "DateCreated": "07/09/2021"
Goal: I would like to find a way in Azure Data Flows or Azure Data Factory to make a new column with a value for a specific key in a list.
Example:
Current Column
Tags
"Department": "Business", "Owner": "Karen Singh", "DateCreated": "09/20/2019"
"Owner": "Henry Francis", "AppName": "physics-engine", "Department": "GeospatialServices"
"Department": "Fashion", "DateCreated": "01/10/2015", "Owner": "Xiuxiang Long"
Desired Column
Owner
"Karen Singh"
"Henry Francis"
"Xiuxiang Long"
Work So Far: I have taken each string in the tags column split it into an array by breaking it apart and the commas (,). Then I have split each string at each index by the colon (:). This makes the values look like:
Tags
[["Department", "Business"], ["Owner", "Karen Singh"], ["DateCreated", "09/20/2019"]]
[["Owner", "Henry Francis"], ["AppName", "physics-engine"], ["Department", "GeospatialServices"]]
[[Department", "Fashion"], ["DateCreated", "01/10/2015"], ["Owner", "Xiuxiang Long"]]
To split the strings, I've used this open expression
mapIndex(split(replace(Tags, '"', ''), ','), split(#item, ':'))
Problems
I am new to Open Expressions and Azure Data Factory and Data Flows. Does anyone know how I would:
Search for the desired tag like "Owner"
And return the value associated to it
Sorry I know this question sounds very simple but using only open expression functions makes this more convoluted than necessary. Additionally, if there is a better way to go about this problem I'd appreciate any input! I've been banging my head against the wall and any leads help. Thank you!
I have tried to repro it, could achieve it using Derived Column, where you could Split():
Use Derived Column transformation and use below expression:
split(split(tags,'"Owner":')[2],'"')[2]
Data Preview:

Sharepoint list column type person

I hope you can help me, I have a sharepoint list, I have a person type column, but I would like to extract the data it has (email, name) and place it as a text type in another column so that when the person type field is changed it also modifies these two but I tried to do it with a calculated column, but I think it is not supported, do you have any idea how to do this type of change.
Thanks
You can achieve it using JSON column formatting code like below:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": {
"operator": "+",
"operands": [
"mail: ",
"[$person.email]",
" name: ",
"[$person.title]"
]
}
}

Sharepoint shows (incomplete) id in "AllItems.aspx"

In a Sharepoint site: "https://(company).sharepoint.com/sites/(subject)/Shared%20documents/Forms/AllItems.aspx" i see among others the column: "Id". This ID however shows only the numbers f.e. 35.
It does not show the complete number "aadduej-35". The complete number is shown when i open the document properties. There i see "Document-id" with the complete prefix and the id number. How do i arrange that in the .aspx is shown "aadduej-35" instead of "35"
All help is appreciated!
Thanks in advance ;-)
You could create a calculated column and set the formula like this:
=CONCATENATE("aadduej-",ID)
Or you could format the column with json formatting:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": {
"operator": "+",
"operands": [
"aadduej-",
" ",
"[$ID]"
]
}
}

Custom formatting of a field in Sharepoint List

I have a sharepoint list. One of the fields in it(called DocNumber) is the document number including version. It will look like this ESI-1234-1.0
Basically the rule is, it should start with the text ESI-, then a number, followed by another hipen(-), followed by version number, then a dot(.), and a subversion number
How do i write the 'Column validation' for this. I'm using Sharepoint Online(365 I guess), so there's a placeholder in field level settings to write this formula. I searched online but the syntax is so difficult that I'm finding it hard to customize the formula -
I need something like this, but i don't want to indicate position because the numbers there could be of any length(its a serial number, currently we are at 1600, so we should support 1 to 5 digits atleast and version could be any number from 1 to 99)
=AND(
IF(ISERROR(FIND("ESI-",DocNumber,1)),FALSE,(FIND("ESI-",DocNumber)=1)),
IF(ISERROR(FIND("-",DocNumber,4)),FALSE,(FIND("-",DocNumber,4)=4)))
Thankyou for your help!
In the formula property of column You may use JSON structure like this:
{
"elmType": "div",
"txtContent": {
"operator": "+",
"operands": [
"ESI-",
"[$ID]",
"-",
"[$_UIVersionString]"
]
}
}
here we make a custom view in a div HTML element with text inside. The Text is static string "ESI-" then we add ID column then we add "-" then we add version number column as string
the result should be something like this
... I hope this will be of any help

How do I find all exact matches within a block of text in Elasticsearch?

I've got an index of hundreds of book titles in elasticserch, with documents like:
{"_id": 123, "title": "The Diamond Age", ...}
And I've got a block of freeform text entered by a user. The block of text could contain a number of book titles throughout it, with varying capitalization.
I'd like to find all the book titles in the block of text, so I can link to the specific book pages.
Any idea how I can do this? I've been looking around for exact phrase matches in blocks of text, with no luck.
You need to index the field title as not_analyzed or using keyword analyzer.
This will tell elasticsearch to do no operations on the field whenever you send a query and this will make you be able to do an exact match search.
I would suggest that you keep an analyzed version as well as a not_analyzed version in order to be able to do exact searches as well as analyzed searches. Your mappings would go like this, in this case I assume that the type name is movies in your case.
"mappings":{
"movies":{
"properties":{
"title":{
"type": "string",
"fields":{
"row":{
"type": "string",
"index": "not_analyzed"
}
}
}
}
}
}
This will give you two fields title which contains an analyzed title and title.row which contains the exact value indexed with absolutely no processing.
title.row would match if you entered an exact

Resources