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
yashag2255
Dual Super User II
Dual Super User II

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
yashag2255
Dual Super User II
Dual Super User II

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

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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors
Users online (2,642)