'Newly added SharePoint List column is hidden - SPFx WebPart
I added list column as below using pnp js and api call is working without issue. but Column is hidden even it is created.
is there any reason for that ?
var fieldXML = "<Field Hidden='FALSE' DisplayName='455' Format='Dropdown' IsModern='TRUE' MaxLength='255' Name='455' Title='455' Type='Text'><Default>11</Default></Field>";
sp.web.lists.getByTitle("listTitle").fields.createFieldAsXml(fieldXML).then(function (result) {
//success
});
Solution 1:[1]
If you are scanning a nested array, here's one way to about that using includes to check the actors array.
const moviesList = [{
"movieId": 4192148,
"title": "Highly Functional",
"actors": [
3188187,
3306943,
132257,
47265
]
},
{
"movieId": 11111,
"title": "Highly Functional2",
"actors": [
3188187,
3306943,
206,
47265
]
},
{
"movieId": 11112,
"title": "Highly Functional3",
"actors": [
3188187,
3306943,
206,
47265
]
}
];
let matches = [];
for (const movie of moviesList) {
const { actors, movieId } = movie;
if (actors.includes(206)) {
matches.push(movieId);
}
}
console.log(matches);
// Another format
matches = moviesList
.filter(({ actors }) => actors.includes(206))
.map(({ movieId }) => movieId)
console.log(matches);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
