cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Chriss1982
Helper I
Helper I

Read out title via substring issue

Hi all, 

 

I wan to create a custom ID based on document title (e.g 9874-Document.docx).  ID should be then "9874".

But the flow always failed while using a substring with this message:

InvalidTemplate. Unable to process template language expressions in action 'Set_variable' inputs at line '1' and column '2639': 'The template language function 'substring' expects its first parameter 'string' to be a string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#substring for usage details.'.
 
This is the responsible flow part:
Flowsubstring.PNG
Any ideas?
Flowsubstring.PNG
1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Chriss1982 

 

Can you share more details on the trigger you are using? You can get the name of the document from the filename with extension attribute rather than using the Title attribute: 

ffds.PNG

 

Expression: 

substring(variables('kd'),1,4)

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

2 REPLIES 2

Hi @Chriss1982 

 

Can you share more details on the trigger you are using? You can get the name of the document from the filename with extension attribute rather than using the Title attribute: 

ffds.PNG

 

Expression: 

substring(variables('kd'),1,4)

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Hi @yashag2255 

 

thanks for your fast reply.

 

Your solution works. For some reason my expression seems to be wrong (triggerbody).

Thank you!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022- Season 2 has kicked off!

Users online (4,088)