Hi, I'm having troubles with writing this to excel.
Currently, extract this from a PDF. I include the "Date:" as there is no space therefore power automate picks it up as one

(dd-MM-yyyy)
I take the text output from the AI model and using this expression get just the date:
slice(outputs('Extract_information_from_documents')?['body/responsev2/predictionOutput/labels/Trade_00b8095d61d243f4b6293739258a33c7bd/text'], sub(indexOf(outputs('Extract_information_from_documents')?['body/responsev2/predictionOutput/labels/Trade_00b8095d61d243f4b6293739258a33c7bd/text'], '/'), 2), lastIndexOf(outputs('Extract_information_from_documents')?['body/responsev2/predictionOutput/labels/Trade_00b8095d61d243f4b6293739258a33c7bd/text'], ' '))
From here I get the correct output of 09/06/2022 (dd-MM-yyyy). I can see this in the Add row to table outputs when the flow runs.
However, when I open the excel file the date comes out as 06/09/2022. (MM-dd-yyyy)
I've checked excel is formatting the cells as they should i.e. UK formatting
I've tried adding in formatDateTime({above expression}), 'yyyy-MM-dd') but I then get an error with other dates going through saying: "Unable to process template language expressions in action 'Add_a_row_into_a_table_4' inputs at line '0' and column '0': 'In function 'formatDateTime', the value provided for date time string '18/04/2023' was not valid. The datetime string must match ISO 8601 format.'."
How would you suggest going about this?
Thank you ahead!