cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Send HTTP request to SharePoint - POST multiple fields on new list item - JSON code

Hi there!

 

I am trying to use this REST to create a new list item. I can get it to work with just the first field ("Title"). But I can't seem to get the code right to update the second field. 

 

As the list name is dynamic, it is not as simple as adding another step to update the list item. json code trouble.PNG

5 REPLIES 5
ChristianAbata
Super User
Super User

hi @Anonymous  please see the example below

example.png



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
Anonymous
Not applicable

@ChristianAbata this is the example I started with but my flow would never resolve the "type" when I used the SP.Data.ListName.ListItem

 

I had to use the SP.FieldText to get my title to post. and it won't apply to the Adherence column because it is a number value. I either have the wrong type for Adherence or my JSON is written incorrectly. I am trying to use https://quicktype.io/ to format the JSON and I'm getting an error on the flow on invalid JSON.

@Anonymous  Maeby you can try with this json

 

[{
"_metadata":{
	"type": "SP.FieldText"
	},
	"Title": "Week"
},
{
"_metadata":{
	"type": "SP.FieldText"
	},
	"Adherence": "Adherence"
}]


Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
Anonymous
Not applicable

It didn't like the node 😞

 

So I reversed the {} and the [] at the beginning and end, and I'm back to the same error:

 

 
"message": "Invalid JSON. The property name '' is not valid. The name of a property cannot be empty.\r\nclientRequestId: 95c766aa-acdb-41bf-8c4b-cc0ca0d62de4\r\nserviceRequestId: ce98399f-f0dc-9000-8099-f5c92a3488ee",
"status": 400,
 

@Anonymous  could you share an screanshot?



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,875)