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

Extract and Replace

Hi,

 

How do I extract and replace string in one expression rather than creating another Compose?

 

 

substring(triggerOutputs()?['body/Category/Value'],0,3, replace(triggerOutputs()?['body/Category/Value'],' ','_'))

 

 

This is the error I received

The function 'substring' expects two parameters; 'source string' as the first parameter, and the 'start index' as the second parameter. But only '4' parameter(s) provided.

1 ACCEPTED SOLUTION

Accepted Solutions
Spaceballs
Helper I
Helper I

@srduval 

Yup, that works

replace(substring(triggerOutputs()?['body/Category/Value'],0,3),' ','_')

 

View solution in original post

2 REPLIES 2
srduval
Super User
Super User

your source string needs to be your replaced value. move the whole replace section and replace the first

triggerOutputs()?['body/Category/Value']

Spaceballs
Helper I
Helper I

@srduval 

Yup, that works

replace(substring(triggerOutputs()?['body/Category/Value'],0,3),' ','_')

 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (1,166)