cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
trishmalloy
Post Partisan
Post Partisan

Format Date Bucket Name and Assigned to fields

Hi Folks,

 

Is there a way to format the date w/out the time and get the Bucket name, not ID and Display Name instead of the ID?

 

Format Date Bucket and Assigned to.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User
Super User

Hi @trishmalloy,

 

For the first part you can use a formatdateTime: https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#f...

 

You can for instance apply a short date pattern, which is 'd'. Btw, in my example I am only formatting the first item from my list tasks action. 

 

formatdateTime(outputs('List_tasks')?['body/value'][0]['startDateTime'], 'd')

 

 formatdatetime_shortdatepattern.png

 

For the second part you will have to add some logic to retrieve the bucket names from your plan and to filter the list of buckets to the correct bucket and the corresponding name value you want to present.

 

1. Add a List buckets action

listbuckets.png

2. Add a Filter Array action. Use the list buckets value as input in the from field. Use your bucketid value in the first field of the filter.

filterarray_buckets02.png

 

3. Add for example a compose and add the following expression to it. Of course, you can use this expression in other actions. For instance in the create HTML table action you used.

 

body('Filter_Array')[0]['name']

 

bucketname.png

View solution in original post

6 REPLIES 6
Expiscornovus
Super User
Super User

Hi @trishmalloy,

 

For the first part you can use a formatdateTime: https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#f...

 

You can for instance apply a short date pattern, which is 'd'. Btw, in my example I am only formatting the first item from my list tasks action. 

 

formatdateTime(outputs('List_tasks')?['body/value'][0]['startDateTime'], 'd')

 

 formatdatetime_shortdatepattern.png

 

For the second part you will have to add some logic to retrieve the bucket names from your plan and to filter the list of buckets to the correct bucket and the corresponding name value you want to present.

 

1. Add a List buckets action

listbuckets.png

2. Add a Filter Array action. Use the list buckets value as input in the from field. Use your bucketid value in the first field of the filter.

filterarray_buckets02.png

 

3. Add for example a compose and add the following expression to it. Of course, you can use this expression in other actions. For instance in the create HTML table action you used.

 

body('Filter_Array')[0]['name']

 

bucketname.png

trishmalloy
Post Partisan
Post Partisan

@Expiscornovus 

 

I tried your solution for formatting the date but I don't notice any difference. What am I missing? I don't want anything past the date.

 

formatDate.png

Expiscornovus
Super User
Super User

Hi @trishmalloy,

 

The example of the expression I shared was only formatting the date of the first record of a List of tasks, that's why it has the [0] index in the expression. I thought you only needed to format one row, because you only showed one row in your first screenshot, my bad.

 

An example of such an expression in for instance an apply to each could like similar like this:

formatdateTime(items('Apply_to_each_2')?['startDateTime'], 'd')

applytoeachformatdatetime.png

 

Sorry to be a numbskull. I've tried adding the "apply to each" in various parts of the Send a digest email of all outstanding Planner tasks template and it's still using the long datetime. I'd love some more help!

Also, I tried adding the Filter Array for to get the Bucket Name below the Filter array that comes with the template, no luck there either.

Expiscornovus
Super User
Super User

Hi @trishmalloy,

 

Can you share a couple of new screenshots?

 

Ideally one screenshot of the whole flow and one screenshot of the configuration of that specific email action (in edit mode).   

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.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (1,640)