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

Select Day or Month only from string

Hi

 

I am trying to select either the day or the month from the current date. I am not sure what i am doing wrong here? So far  i have:

 

1. Action to get the current time.

2. convert output of action 1 by using the "Convert time zone", Long date pattern( Monday, June 15, 2009)

3. use compose to select the day or the month from action 2, but its not working. I am not sure of the syntax to use?  

Capture.PNG

 

code i am using for the compose:

 

first(split(outputs('Current_time'),', "'))

 

Any help would be appreciated. 

 

Regards

 

Tyron

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @ CHF,

 

Could you please share an example to explain more about your requirement?

Do you want to get the Day or Month only from string?

 

I have made a test on my side,and have created a flow as below:

Capture.PNG

 

The flow woud run successfully as below:

Capture.PNG

 

Could you please share an example about what you want to get from the string "Saturday, April 28, 2018"?

Do you want to get the "28" as day of the string "Saturday, April 28, 2018" and "April" as month of the string "Saturday, April 28, 2018"?

 

If want to get the "28" as day of the string "Saturday, April 28, 2018" and "April" as month of the string "Saturday, April 28, 2018",please refer to screenshot below to create the flow:

Capture.PNG

 

 

The expression in the Compose 2 as below:

 

first(skip(split(outputs('Compose'),','),1))

 

The expression in the Compose 3 as below:

 

first(skip(split(outputs('Compose_2'),' '),1))

 

The expression in the Compose 4 as below:

first(skip(split(outputs('Compose_2'),' '),2))

The flow would run successfully as below:

Capture.PNG

 

Please let me know if your problem could be solved.

 

 

Regards,
Alice Zhang

View solution in original post

2 REPLIES 2
Community Support
Community Support

Hi @ CHF,

 

Could you please share an example to explain more about your requirement?

Do you want to get the Day or Month only from string?

 

I have made a test on my side,and have created a flow as below:

Capture.PNG

 

The flow woud run successfully as below:

Capture.PNG

 

Could you please share an example about what you want to get from the string "Saturday, April 28, 2018"?

Do you want to get the "28" as day of the string "Saturday, April 28, 2018" and "April" as month of the string "Saturday, April 28, 2018"?

 

If want to get the "28" as day of the string "Saturday, April 28, 2018" and "April" as month of the string "Saturday, April 28, 2018",please refer to screenshot below to create the flow:

Capture.PNG

 

 

The expression in the Compose 2 as below:

 

first(skip(split(outputs('Compose'),','),1))

 

The expression in the Compose 3 as below:

 

first(skip(split(outputs('Compose_2'),' '),1))

 

The expression in the Compose 4 as below:

first(skip(split(outputs('Compose_2'),' '),2))

The flow would run successfully as below:

Capture.PNG

 

Please let me know if your problem could be solved.

 

 

Regards,
Alice Zhang

View solution in original post

Hi

 

Thanks for the response, your first compose was what I was missing. I kept getting an object reference error in my testing. After adding that step, it started to work.  

 

 

As you asked you wanted an example, here it is:

 

I needed an out of the day and the month:

 

Day: Monday

Month: May

 

I changed your compose 4 to select the day(word) rather than the number. 

first(skip(split(outputs('Compose'),','),0))

Which gives me the day in words.

 

Thanks for your help! 

 

Regards

 

Tyrone

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (12,879)