Create list item inside a folder

Hi all, I'm struggling with the creation of a new list item inside an existing folder. I've tried this but always get an error telling that the property Title (Or whatever I select) doesn't exists in Type 'SP.ListItemFormUpdate':


const listFolderPath = ""+folder.toString();'Asistencia').addValidateUpdateItemUsingPath([
     {Title: "Asistencia", Asistencia: "OK", AsistenteId: item.Miembro.ID, MinutaId: Minuta}],


Uncaught (in promise) Error: Error making HttpClient request in queryable [400] Bad Request ::> {"odata.error":{"code":"-1, Microsoft.Data.OData.ODataException","message":{"lang":"es-ES","value":"La propiedad 'Title' no existe en el tipo 'SP.ListItemFormUpdateValue'. Aseg\u00farese de que solo usa nombres de propiedad que se definen por el tipo."}}}

Also notice that I have a list control binded to this list in the form and with the correct folder as root folder. I was wondering if it is possible to create this item directly from the control. I've seen it has an "_additem" function, it is possible to create this element with this function?

Thanks in advance

Hello @Pedro,

Welcome to Plumsail Community!

You can create an item and then move it to the folder using the code:

let folderUri = '/folderName';
let listUri = '/sites/SiteName/Lists/ListName';

        Title: 'new'
    .then((item) => {
        return pnp.sp.web

Thank you @mnikitina!,
this workaround forces to assign permissions in root folder to the users. There is no other way to do it?
The function I'm trying, is not an option?



You can try out this code:

const webUrl = _spPageContextInfo.webAbsoluteUrl;

const listPath=webUrl+"/Lists/ListName";
const folderName="folder name";"ListName").addValidateUpdateItemUsingPath([
    { FieldName: 'Title', FieldValue: 'Value1'}]    

Thank you @mnikitina it works!, but I'm not able to update a user field that I have in this list.
I tried using ID and Name (i:0#.f|membership|
How do I need to pass this parameter?"Assist").addValidateUpdateItemUsingPath([
        { FieldName: 'Title', FieldValue: 'Value1' },
        { FieldName: 'User', FieldValue: User.toString() },



You can use this code to populate Person or Group field:

{FieldName: 'User', 
FieldValue: JSON.stringify([{"Key": "i:0#.f|membership|"+"UserEmail"}])}

Now is perfect, thank you @mnikitina!

1 Like