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

Apply to each in JSON array

Hi guys, 

 

I'm working on a new flow that calls an API that returns a list of apps and returns the following: 

I need to access the passwordCredentials array and convert the timezone of the endDateTime for each app returned. How can I do this in my flow?

 

 

 

 

 

{
      "appId": "8a965c0b-e95b-461e-9f25-923831831776",
      "displayName": "Testing for Client Expiry - Test 1",
      "passwordCredentials": [
        {
          "customKeyIdentifier": null,
          "displayName": "6 month expiry secret 2",
          "endDateTime": "2022-01-01T05:04:04.108Z",
          "hint": "9_T",
          "keyId": "4adffe76-fc34-4490-be6a-61ab92eaedf9",
          "secretText": null,
          "startDateTime": "2021-07-01T05:04:04.108Z"
        },
        {
          "customKeyIdentifier": null,
          "displayName": "7 days expiry",
          "endDateTime": "2021-07-06T16:00:00Z",
          "hint": ".FG",
          "keyId": "026353f2-f886-475c-b27f-30c6f6ef0bc0",
          "secretText": null,
          "startDateTime": "2021-06-30T07:24:54.719Z"
        }
      ],

 

 

 

I am currently doing the following, however, in cases where there are more than 1 endDateTime, it doesn't work.

 

TSYong_0-1625122902651.png

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
DamoBird365
Super User
Super User

Hi @TSYong 

 

I have a single action that can return the dates as an array.  The expression within might help you too.

 

I have inserted your sample array into a compose and then using Select, returned an array of dates in singapore standard time using the following expression:
 
converttimezone(item()?['endDateTime'],'UTC','Singapore Standard Time')
DamoBird365_0-1625129291982.png

 

 Here is the result:
DamoBird365_1-1625129311373.png

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

View solution in original post

2 REPLIES 2
DamoBird365
Super User
Super User

Hi @TSYong 

 

I have a single action that can return the dates as an array.  The expression within might help you too.

 

I have inserted your sample array into a compose and then using Select, returned an array of dates in singapore standard time using the following expression:
 
converttimezone(item()?['endDateTime'],'UTC','Singapore Standard Time')
DamoBird365_0-1625129291982.png

 

 Here is the result:
DamoBird365_1-1625129311373.png

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

View solution in original post

TSYong
Helper II
Helper II

Hello Damo! That works like a charm! Thanks!

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Top Solution Authors
Users online (958)