cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ahmed2
Helper II
Helper II

Create an item inside a folder in sharepoint list- Probelm with Send HTTP

Hello,  good afternoon to everyone.
I am trying to create an item in a SharePoint list inside a folder, I found a great way here answered by @Expiscornovus using send an HTTP request, but for some reason, the flow takes about 13 mins to run then fails, giving me an error "Bad gateway"

I attach below a screenshot of the flow, can someone please tell me what I am doing wrong?

thanks a lot

tempsnip.png

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User
Super User

Hi @Ahmed2,

 

Just tested it myself in one of my demo environments.

 

I used this for the body:

{
  "listItemCreateInfo": {
    "FolderPath": {
      "DecodedUrl": "https://contoso.sharepoint.com/sites/GRP-PAR-PHARMA-New-Articles-Requests-Newarticlerequests/lists/New article requests/ANAESTHESIE-ANESTHESIA"
    },
    "UnderlyingObjectType": 0
  },
  "formValues": [
    {
      "FieldName": "Title",
      "FieldValue": "Item in Folder"
    }
  ],
  "bNewDocumentUpdate": false
}

 

Below is a screenshot of my test.

createiteminfolder.png

View solution in original post

12 REPLIES 12
Expiscornovus
Super User
Super User

Hi @Ahmed2,

 

I see you are inputting a lot of field values of your Microsoft form in the Title field, is that correct?

 

The maximum number of characters of a Title field is 255. So, you might be reaching that limit. 

 

What will the title be in this example?

 

 

Helle @Expiscornovus 

The title is quite small, as, in the form, only one of these fields is filled, so usually it is not above 10 characters.

ex RF 2021 TEST 1

Expiscornovus
Super User
Super User

Hi @Ahmed2,

 

Thanks for validating. That sounds good, shouldn't raise an issue in storing that value.

 

I had a look at your screenshot. The DecodeUrl looks different compared to your Site Address. Can you double check if that is correct?

 

typodecodeurl.png

Hello @Expiscornovus 

Yes you are right, i had an extra dash, but after fixing it, i am still getting the same issue, i realized maybe i am writting my URL or URI wrong?

for info

This is my site address

https://msfintl.sharepoint.com/sites/GRP-PAR-PHARMA-New-Articles-Requests-Newarticlerequests 

and this is my list name

New article requests

and my folder name is

ANAESTHESIE-ANESTHESIA

so i wrote the DecodedUrl as below 

https://msfintl.sharepoint.com/sites/GRP-PAR-PHARMA-New-Articles-Requests-Newarticlerequests/Lists/N... article requests/ANAESTHESIE-ANESTHESIA

below is a screen shot, do you think this is the problem?

Ahmed2_0-1632403615312.png

Thank again for the help

Ahmed2
Helper II
Helper II

Hi @Expiscornovus 

sorry, i added the DecodedUrl  wrong, this is how i wrote it

https://msfintl.sharepoint.com/sites/GRP-PAR-PHARMA-New-Articles-Requests-Newarticlerequests/Lists/N... article requests/ANAESTHESIE-ANESTHESIA

Expiscornovus
Super User
Super User

Hi @Ahmed2,

 

Just tested it myself in one of my demo environments.

 

I used this for the body:

{
  "listItemCreateInfo": {
    "FolderPath": {
      "DecodedUrl": "https://contoso.sharepoint.com/sites/GRP-PAR-PHARMA-New-Articles-Requests-Newarticlerequests/lists/New article requests/ANAESTHESIE-ANESTHESIA"
    },
    "UnderlyingObjectType": 0
  },
  "formValues": [
    {
      "FieldName": "Title",
      "FieldValue": "Item in Folder"
    }
  ],
  "bNewDocumentUpdate": false
}

 

Below is a screenshot of my test.

createiteminfolder.png

View solution in original post

Hi @Expiscornovus 

    So i really don't know what i am doing wrong, could it be due to the trigger? i am using response form

Ahmed2_0-1632405527783.png

 

Ahmed2
Helper II
Helper II

@Expiscornovus i think i found the problem, the URL name is different from the display name, that was the source of my error

thanks a lot 

Expiscornovus
Super User
Super User

Hi @Ahmed2,

 

Great to hear that you managed to solve it 🙂

Ahmed2
Helper II
Helper II

Hello @Expiscornovus 

     Yes i did, but i ran into another issue while completing th JSON.

i am trying to add the rest of the item elements, but i seem to be writting something wrong, is this how it is supposed to be added? Or can you kindly guide me on how to write it correctly?

thanks in advance

ex

{
  "listItemCreateInfo": {
    "FolderPath": {
      "DecodedUrl": "https://contoso.sharepoint.com/sites/GRP-PAR-PHARMA-New-Articles-Requests-Newarticlerequests/lists/New article requests/ANAESTHESIE-ANESTHESIA"
    },
    "UnderlyingObjectType": 0
  },
  "formValues": [
    {
      "FieldName": "Title",
      "FieldValue": "Item in Folder"
    }
  ],
  "bNewDocumentUpdate": false
}

 

 

Ahmed2
Helper II
Helper II

hi @Expiscornovus 

apologies, i added the original one

this is what i meant

{
  "listItemCreateInfo": {
    "FolderPath": {
      "DecodedUrl": "https://contoso.sharepoint.com/sites/GRP-PAR-PHARMA-New-Articles-Requests-Newarticlerequests/lists/New article requests/ANAESTHESIE-ANESTHESIA"
    },
    "UnderlyingObjectType": 0
  },
  "formValues": [
    {
      "FieldName": "Title",
      "FieldValue": "Item in Folder"
    },
    {
      "FieldName": "Title2",
      "FieldValue": "Item in Folder2"
    },
    {
      "FieldName": "Title3",
      "FieldValue": "Item in Folder3"
    }
  ],
  "bNewDocumentUpdate": false
}
Expiscornovus
Super User
Super User

Hi @Ahmed2,

 

The json like above would create one list item with three field values. If that is what you are looking for your json would be correct 😀

 

See my example below

{
  "listItemCreateInfo": {
    "FolderPath": {
      "DecodedUrl": "https://contoso.sharepoint.com/sites/GRP-PAR-PHARMA-New-Articles-Requests-Newarticlerequests/lists/New article requests/ANAESTHESIE-ANESTHESIA"
    },
    "UnderlyingObjectType": 0
  },
  "formValues": [
    {
      "FieldName": "Title",
      "FieldValue": "Item in Folder"
    },
   {
      "FieldName": "Title2",
      "FieldValue": "Field Value 2"
    },
   {
      "FieldName": "Title3",
      "FieldValue": "Field Value 3"
    }
  ],
  "bNewDocumentUpdate": false
}

 

Result of that json body.

 

example_threefields.png

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,078)