Comments (16)
I am unable to recreate this issue and am going to close it since it is not an issue with any of the samples in this repo. Please feel free to create a new issue on sp-dev-docs/issues if this continues to be a problem for you. Thanks!
from list-formatting.
This works:
{ "$schema": "http://columnformatting.sharepointpnp.com/columnFormattingSchema.json", "debugMode": true, "elmType": "div", "children": [ { "elmType": "a", "attributes": { "target": "_blank", "href": { "operator": "+", "operands": [ "https://tenant.sharepoint.com/sites/devsite/", "[$ID]" ] } }, "txtContent": "Some text" } ] }
from list-formatting.
I have the same issue.
I can insert [$Title] as a part of the url, but using [$ID] gives me: Failure: Cannot read property 'valueOf' of null.
from list-formatting.
There is no difference between applying column formatting via PowerShell, the format this column display panel (listview), field or site column editing screens, or through the API using something like the Column Formatter webpart.
More likely, there is something else wrong with the format. Could you post the whole format for us to have a look? Thanks!
from list-formatting.
I had the same issue and I could reproduce and fix it.
The Error "Cannot read property 'valueOf' of null." occurs if, the field "ID" is manually added to the Listview.
You can fix the error by removing the Field from the Listview and by inserting the following Code:
{ "$schema": "http://columnformatting.sharepointpnp.com/columnFormattingSchema.json", "elmType": "a", "txtContent": "[$ID]", "attributes": { "target": "_blank", "href": { "operator": "+", "operands": [ "http://finance.yahoo.com/quote/", "[$ID]" ] } } }
from list-formatting.
@samikroy I'm a little late to the game, but at least currently, I can use your JSON format without issue on a modern listview. Is this still a problem for you?
from list-formatting.
I just tried both examples above, adding the JSON to a Number field, which had nothing to do with the JSON. I'm also not displaying the ID column in the view. In both cases, the link was generated and worked.
@PerIngeH, it's possible you have some other issue in your JSON. Can you try the examples above?
from list-formatting.
Hi PerIngeH,
You can create another column with calculated value from ID (For instance : [$IDText] - calculated) and see the magic will be happened.
.
from list-formatting.
I have same problem. When use [$ID] it is empty or error Failure: Cannot read property 'valueOf' of null.
Do you have any idea?
from list-formatting.
I used PNP Powershell to set the JSON to the field, that works. Then I can use the Json as provided and create a link using the [$ID] as a parameter.
https://capacreative.co.uk/2018/02/11/using-pnp-powershell-to-apply-modern-column-formatting/
from list-formatting.
Hmm I am not site collection admin and we are prohibited to use powershell.
from list-formatting.
You can run powershell pnp towards a site, but reckon youd need to be at least site admin. But you
ll probably have to work out the legal stuff first.
from list-formatting.
What is the difference when applying it via PNP Poweeshel and via JSON directly ? I still do not get it.
from list-formatting.
I was using about 5 different JSON snippets and if [$ID] is present there is always error.
{
"$schema": "http://columnformatting.sharepointpnp.com/columnFormattingSchema.json",
"elmType": "a",
"txtContent": "[$ID]",
"attributes": {
"target": "_blank",
"href": {
"operator": "+",
"operands": [
"http://finance.yahoo.com/quote/",
"[$ID]"
]
}
}
}
from list-formatting.
I had the same issue so I used a Calculated Field and set the formula to "=ID". In the JSON formatting where I was referencing "[$ID]", I replaced it with "@currentField"
from list-formatting.
I don't know if this should be considered a bug... but I think the issue is that [$ID] exists when you put the formatting on a list but if you put it on a document library [$ID] does not work but then you could do your filter on field FileLeafRef instead using [$FileLeafRef] when building a URL potentially. The other work around being that you add the calculated field to the document library.
from list-formatting.
Related Issues (20)
- Sample - yesno-icon-color not working as intended HOT 5
- I have a question about honeycomb-link when used with an embedded webpart HOT 2
- I have a question about formatting a column that contains a JSON string HOT 2
- I have a question about JSON code in lists HOT 2
- Generic Gantt chart - Date field cannot be edited HOT 6
- Birthday Sample, does not populate birthday. HOT 5
- No longer works as it used to: form-samples/wrapped-body HOT 2
- Gallery View: Scaling of SVG files HOT 1
- honeycomb SAMPLE has made me sad, please help HOT 6
- Changes made by GENERIC-UPDATE-BUTTON are not immediately visible to other users HOT 2
- group-header-remove-column-name-clickable has made me sad, please help HOT 6
- Links do not open in Microsoft Lists App in some samples HOT 8
- I have a question about Praise Cards HOT 3
- Remove 'Editing' Worry From 'Custom Charts' - view-samples/custom-charts HOT 1
- group-header-remove-column-name has made me sad, please help HOT 4
- text-qrcode question/help HOT 5
- View Formatting - Group - GroupProps To Trigger Expand / Contract Without Malforming Header HOT 7
- Birthday Sample List formatting not working with @now HOT 1
- [SUGGESTION] Color Picker Potential HOT 5
- Colorful Honeycomb Links HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from list-formatting.