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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / extract string from re...
Power Automate
Unanswered

extract string from response submitted

(0) ShareShare
ReportReport
Posted on by 8

Hi, 

 

I have a text field in the form which user can enter any number of characters, I am storing details of this form in common data service. As the text column in cds will accept max to 4000, my flow is got failed when character length is more than 4000.

I tried to add an expression mentioned below to extract first 4000 characters when i am inserting record. However am getting below error.

 

I tried below substring functions in expression 

 

substring(triggerBody()?['Reason/Business justification'],1,4000)

error : One or more fields provided is of type 'Null', a different type is expected.
substring(outputs('Get_response_details')?['body/rd07b3c96a0264658bbc3ace8b3711eb9'],1,4000)

error : Unable to process template language expressions in action 'Create_a_new_record' inputs at line '1' and column '90440': 'The template language function 'substring' parameters are out of range: 'start index' and 'length' must be non-negative integers and their sum must be no larger than the length of the string

Can someone please help/suggest me how i can get first 4000 characters when i am inserting data to cds

Thank you!

 

 

Screenshot from 2020-08-19 23-40-56.png

 

Categories:
I have the same question (0)
  • RezaDorrani Profile Picture
    12,145 on at

    Hi @SaiRupa 

     

    Here is your expression. Note: Index starts from 0.

     

    if(greater(length(outputs('Get_response_details')?['body/rd07b3c96a0264658bbc3ace8b3711eb9']) ,4000),substring(outputs('Get_response_details')?['body/rd07b3c96a0264658bbc3ace8b3711eb9'],0,4000),outputs('Get_response_details')?['body/rd07b3c96a0264658bbc3ace8b3711eb9'])

     

    --------------------------------------------------------------------------------
    If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

    Thanks,
    Reza Dorrani, MVP
    YouTube
    Twitter

  • tierneyj Profile Picture
    4 on at

    Hi Reza, this was something that I had been trying to find a solution for, for sometime so much obliged that worked a treat for me. 🤙 P.S - Love the Youtube content you put out....

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 283

#2
David_MA Profile Picture

David_MA 256 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 225 Most Valuable Professional

Last 30 days Overall leaderboard