cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
crystalhowat
Level: Powered On

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
Super User
Super User

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

hi @crystalhowat  please see the example below

example.png





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


Proud to be a Flownaut!





crystalhowat
Level: Powered On

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

@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.

Super User
Super User

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

@crystalhowat  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 😉


Proud to be a Flownaut!





crystalhowat
Level: Powered On

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

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,
 
Super User
Super User

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

@crystalhowat  could you share an screanshot?





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


Proud to be a Flownaut!





Helpful resources

Announcements
firstImage

New Ranks and Rank Icons in April

Read the announcement for more information!

firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (5,114)