cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
amulhearn0207
Regular Visitor

Need to add a date to a column based on a Var Array String in wrong format(AAA:20210810)

Hi,

 

I have a flow which parses a series of information out of an email and adds it to appropriate columns in SharePoint lists.

I need a new column my list, known as depart date.

 

One of the Variable Array strings I have is formatted like this "AAA:20210810." This means that the Depart Date is August 10, 2021.

 

This is my Array Statement:
[
{
"ArrayIndex": 0,
"KeyToFind": "FirstName",
"ValueFound": "FirstNamevalue"
},
{
"ArrayIndex": 1,
"KeyToFind": "MiddleName",
"ValueFound": "MiddleNamevalue"
},
{
"ArrayIndex": 2,
"KeyToFind": "LastName",
"ValueFound": "LastNamevalue"
},
{
"ArrayIndex": 3,
"KeyToFind": "Suffix",
"ValueFound": "Suffix"
},
{
"ArrayIndex": 4,
"KeyToFind": "PassportNo",
"ValueFound": "PassportNovalue"
},
{
"ArrayIndex": 5,
"KeyToFind": "PassportExpiry",
"ValueFound": "PassportExpiryvalue"
},
{
"ArrayIndex": 6,
"KeyToFind": "Nationality",
"ValueFound": "Nationalityvalue"
},
{
"ArrayIndex": 7,
"KeyToFind": "BookingNumber",
"ValueFound": "BookingNumbervalue"
},
{
"ArrayIndex": 8,
"KeyToFind": "DepartureCode",
"ValueFound": "DepartureCodevalue"
}
]

 

I need ArrayIndex 8 to populate the Departure Code column as is, then I need that string to be used again to populate the depart date column.

 

amulhearn0207_0-1627492665404.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @amulhearn0207 :

I've made a test for your reference:

1\The Array:

vbofengmsft_0-1627541572220.png

Value:

[
{
"ArrayIndex": 0,
"KeyToFind": "FirstName",
"ValueFound": "FirstNamevalue"
},
{
"ArrayIndex": 1,
"KeyToFind": "MiddleName",
"ValueFound": "MiddleNamevalue"
},
{
"ArrayIndex": 2,
"KeyToFind": "LastName",
"ValueFound": "LastNamevalue"
},
{
"ArrayIndex": 3,
"KeyToFind": "Suffix",
"ValueFound": "Suffix"
},
{
"ArrayIndex": 4,
"KeyToFind": "PassportNo",
"ValueFound": "PassportNovalue"
},
{
"ArrayIndex": 5,
"KeyToFind": "PassportExpiry",
"ValueFound": "PassportExpiryvalue"
},
{
"ArrayIndex": 6,
"KeyToFind": "Nationality",
"ValueFound": "Nationalityvalue"
},
{
"ArrayIndex": 7,
"KeyToFind": "BookingNumber",
"ValueFound": "BookingNumbervalue"
},
{
"ArrayIndex": 8,
"KeyToFind": "DepartureCode",
"ValueFound": "AAA:20210810."
}
]

2\Convert the date:

vbofengmsft_1-1627541623505.png

Expression:

formatDateTime(
 concat(
  take(Split(split(variables('TheArray')[8]['ValueFound'],':')[1],'.')[0],4),
  '-',
  take(skip(Split(split(variables('TheArray')[8]['ValueFound'],':')[1],'.')[0],4),2),
  '-',
  skip(Split(split(variables('TheArray')[8]['ValueFound'],':')[1],'.')[0],6)
 )
)

The Result:

vbofengmsft_2-1627541671322.png

Best Regards,

Bof

 

View solution in original post

1 REPLY 1
v-bofeng-msft
Community Support
Community Support

Hi @amulhearn0207 :

I've made a test for your reference:

1\The Array:

vbofengmsft_0-1627541572220.png

Value:

[
{
"ArrayIndex": 0,
"KeyToFind": "FirstName",
"ValueFound": "FirstNamevalue"
},
{
"ArrayIndex": 1,
"KeyToFind": "MiddleName",
"ValueFound": "MiddleNamevalue"
},
{
"ArrayIndex": 2,
"KeyToFind": "LastName",
"ValueFound": "LastNamevalue"
},
{
"ArrayIndex": 3,
"KeyToFind": "Suffix",
"ValueFound": "Suffix"
},
{
"ArrayIndex": 4,
"KeyToFind": "PassportNo",
"ValueFound": "PassportNovalue"
},
{
"ArrayIndex": 5,
"KeyToFind": "PassportExpiry",
"ValueFound": "PassportExpiryvalue"
},
{
"ArrayIndex": 6,
"KeyToFind": "Nationality",
"ValueFound": "Nationalityvalue"
},
{
"ArrayIndex": 7,
"KeyToFind": "BookingNumber",
"ValueFound": "BookingNumbervalue"
},
{
"ArrayIndex": 8,
"KeyToFind": "DepartureCode",
"ValueFound": "AAA:20210810."
}
]

2\Convert the date:

vbofengmsft_1-1627541623505.png

Expression:

formatDateTime(
 concat(
  take(Split(split(variables('TheArray')[8]['ValueFound'],':')[1],'.')[0],4),
  '-',
  take(skip(Split(split(variables('TheArray')[8]['ValueFound'],':')[1],'.')[0],4),2),
  '-',
  skip(Split(split(variables('TheArray')[8]['ValueFound'],':')[1],'.')[0],6)
 )
)

The Result:

vbofengmsft_2-1627541671322.png

Best Regards,

Bof

 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,825)