cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
wsalling
Helper III
Helper III

Size Limit on JSON?

Is there a size limit when using the function JSON?  i have large collection that i turn into a JSON object to send to a flow. if i select the first 4000 records and create the JSON it takes a couple of seconds.  But if i try 6000 or more it seems to stop working without an error.  Ideas?

 

9 REPLIES 9
KrishnaV
Super User
Super User

Hi @wsalling,

 

There is no size limit for binary data or text strings beyond available memory on the device. See the below article from @GregLindhorst Power Apps principle manager explaining about JSON IncludeBinaryData or IgnoreBinaryData.

 

https://powerapps.microsoft.com/en-us/blog/json-for-canvas-apps/

 


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

 


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

Thanks, i don't have any of the problem areas they mention.  all just text fields for blob information.

wsalling_0-1594747635392.png

the button does not release, it still looks depressed.

 

markfleet
Advocate II
Advocate II

I too am having this problem.

 

My collection consists of 20 text fields. The JSON function works fine for me for 4000 records but nothing happens at all when I press the button for 5000 records.

 

This appears to be a genuine issue.

 

 

I have the same issue with large json object of hourly data.

what have you done to combat the issue? we had to create length counter to make way smaller ones to pass.

markfleet
Advocate II
Advocate II

This is still an issue which I do not feel relates to available memory.

 

This can be demonstrated by running the below. Variable "jsontest" will be empty. If the Sequence function is changed to 4000 then the variable will be set correctly.

 

Set(jsontest, Blank());
Clear(colDummyColForJson);
ForAll(Sequence(5000),
Collect(colDummyColForJson, {RowIndex: CountRows(colDummyColForJson) + 1})
);
Set(jsontest, JSON(colDummyColForJson))
markfleet
Advocate II
Advocate II

In case this is useful for anyone else, this is how I run JSON() in batches and still send to my flow in one go. I am collecting the results from the batched JSON into a collection and then running JSON() again on this when running the flow.

 

Clear(colBatchedJson);
With({BatchSize: 1000, RowCount: CountRows(colSourceCollection)},
	With({BatchCount:  RoundUp(RowCount / BatchSize, 0)},
		ForAll(RenameColumns(Sequence(BatchCount), "Value", "i"),
			Collect(
				colBatchedJson,
				{
					Index: i,
					Json: JSON(
						LastN(
							FirstN(colSourceCollection,
								i * BatchSize
							),
							BatchSize - Max(
								((i * BatchSize) - CountRows(colSourceCollection)),
								0
							)
						)
					)
				}
			)
		)
	)
);

FlowToRun.Run(
	JSON(colBatchedJson)
)

 

 

This does mean some further work is required in the flow to iterate over the batches. I am passing this data to SQL Server within the flow so I am doing the work there rather than within the flow but a combined array of the data could be created within the flow too.

markfleet
Advocate II
Advocate II

Another option to combine the batches in the app meaning no changes required in the flow.

 

Clear(colBatchedJson);
With({BatchSize: 1000, RowCount: CountRows(colSourceCollection)},
	With({BatchCount:  RoundUp(RowCount / BatchSize, 0)},
		ForAll(RenameColumns(Sequence(BatchCount), "Value", "i"),
			Collect(
				colBatchedJson,
				{
					Index: i,
					Json: JSON(
						LastN(
							FirstN(colSourceCollection,
								i * BatchSize
							),
							BatchSize - Max(
								((i * BatchSize) - CountRows(colSourceCollection)),
								0
							)
						)
					)
				}
			)
		)
	)
);
UpdateIf(colBatchedJson, true, {Json: Left(Mid(Json, 2), Len(Json) - 2)});

FlowToRun.Run(
	Concatenate("[", Concat(colBatchedJson, Json, ","), "]")
)
londontoholland
Helper I
Helper I

I'm also having the same issue. If the collection is more than about 4000 records, the JSON function will not work (there's no image/file data in there... just text)

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

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,950)