cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CHF
Level: Powered On

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
Highlighted
Community Support Team
Community Support Team

Re: Select Day or Month only from string

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
Highlighted
Community Support Team
Community Support Team

Re: Select Day or Month only from string

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

CHF
Level: Powered On

Re: Select Day or Month only from string

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
firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Users online (5,080)