web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / SSRS to PDF using Powe...
Power Automate
Unanswered

SSRS to PDF using Power Automate Flow - Error "The length of substring can't be longer than '40965'"

(0) ShareShare
ReportReport
Posted on by

Hello,

I have created a power automate flow to execute SSRS report and create a pdf copy of that report. While executing, flow is throwing an error as below:  

ali_betach_0-1673569119915.png

The expression used in this action is as below: 

replace(substring(outputs('Invoke_an_HTTP_request')?['body'],outputs('PDF_Download_start_-_Index'),outputs('PDF_Download_String_Length')),'\u0026','&')
 
Above expression is using output from two other actions as below:
ali_betach_1-1673569382258.png

Expression: 

add(indexOf(outputs('Invoke_an_HTTP_request')?['body'],'"PdfDownloadUrl":"'),18)
 
ali_betach_2-1673569425489.png

Expression: 

sub(indexOf(outputs('Invoke_an_HTTP_request')?['body'],'","PdfPreviewUrl"'),outputs('PDF_Download_Start_-_Index'))
 
During investigation I found action "PDF Download String Length" is returning negative value i.e. -18 
ali_betach_3-1673569567670.png

This is because the first portion of the expression from action "PDF Download String Length" is returning -1 value

First portion of the expression: indexOf(outputs('Invoke_an_HTTP_request')?['body'],'","PdfPreviewUrl"')

 

Below is the HTTP POST action 

ali_betach_4-1673569813821.png

 

From this point I have no idea how to resolve this and what is causing it.

 

Any help would be GREATLY appreciated 🙂

 

Thanks,

Ali

 

 
Categories:
I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard