Closed bhoomesh-spe closed 6 months ago
Hi. Just pass in the multi-line text field props you want, plus the Field Types
const field = sp.web.lists.getByTitle("Test").fields.getByTitle('SingleLine');
await field.update({
NumberOfLines: 6,
FieldTypeKind: 3
}, "SP.FieldMultiLineText");
@bcameron1231 - Thanks for the reply. It threw me an error NumberOfLines property is not present.
@bhoomesh-spe Ah, apologies, ya you can't set the number of lines until it's a multiline text field.
const field = sp.web.lists.getByTitle("Test").fields.getByTitle('SingleLine');
//convert to multiline text field
await field.update({
FieldTypeKind: 3
}, "SP.FieldMultiLineText");
// update multiline text field (optional)
await field.update({
NumberOfLines: 6,
}, "SP.FieldMultiLineText");
Closing this issue as answered. If you have additional questions or we did not answer your question, please open a new issue, ref this issue, and provide any additional details available. Thank you!
This issue is locked for inactivity or age. If you have a related issue please open a new issue and reference this one. Closed issues are not tracked.
What version of PnPjs library you are using
3.x
Minor Version Number
3.15.0
Target environment
SharePoint Framework
Additional environment details
SharePoint Online, SPFx, React
Question/Request
Hello Everyone,
I have created a SharePoint list and column programmatically using the below code.
I have taken a reference from Add a New Field and Ensure that a List exists links.
Now, I need to change the Comment column type from single-line text to multi-line text. So, I have checked Update a Field link but there is no option for changing the type of the existing column.
Can anyone help me with the same?
Thanks