I have the XML code shown below in a flow sending a request to a SOAP API. When passing the date in the format below the flow works and returns the required XML response. I need to make the dates dynamic e.g. today + 365 days. I have tried replacing the fromDate and toDate code with the following, this works in SOAPUI and returns the required XML however in PowerAutomate it returns a an error as below. Can anyone give me any guidance as to how to fix this or some alternatives for request a date using a relative date?
Amended Date XML
<fromDate xsi:type="xsd:string">${=def now = new Date();now.format("yyyy-mm-dd")}</fromDate>
<toDate xsi:type="xsd:string">${=def now = new Date()+365;now.format("yyyy-mm-dd")}</toDate>
Original Working Code (API Key Hidden)
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:uri="uri:FlexForce">
<soapenv:Header/>
<soapenv:Body>
<uri:wsdlGetSchedulesV3 soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<apiKey xsi:type="xsd:string">****-****-****-****</apiKey>
<GetSchedulesV3 xsi:type="flex:GetSchedulesV3" xmlns:flex="https://api.quinyx.com/soap/FlexForce">
<!--You may enter the following 16 items in any order-->
<!--Optional:-->
<section xsi:type="xsd:string"></section>
<!--Optional:-->
<badgeNo xsi:type="xsd:string"></badgeNo>
<!--Optional:-->
<employeeId xsi:type="xsd:int"></employeeId>
<fromDate xsi:type="xsd:string">2022-02-01</fromDate>
<!--Optional:-->
<fromTime xsi:type="xsd:string"></fromTime>
<toDate xsi:type="xsd:string">2022-03-01</toDate>
<!--Optional:-->
<toTime xsi:type="xsd:string"></toTime>
<!--Optional:-->
<scheduledShifts xsi:type="xsd:boolean">False</scheduledShifts>
<!--Optional:-->
<absenceShifts xsi:type="xsd:boolean">True</absenceShifts>
<!--Optional:-->
<modifiedAfter xsi:type="xsd:string"></modifiedAfter>
<!--Optional:-->
<modifiedBefore xsi:type="xsd:string"></modifiedBefore>
<!--Optional:-->
<includeCosts xsi:type="xsd:boolean">False</includeCosts>
<!--Optional:-->
<useFixedSchedule xsi:type="xsd:boolean">False</useFixedSchedule>
<!--Optional:-->
<includeNOI xsi:type="xsd:boolean">False</includeNOI>
<!--Optional:-->
<includeTags xsi:type="xsd:boolean">False</includeTags>
<!--Optional:-->
<includeExtScheduleId xsi:type="xsd:boolean">False</includeExtScheduleId>
</GetSchedulesV3>
</uri:wsdlGetSchedulesV3>
</soapenv:Body>
Response Error
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="https://api.quinyx.com/soap/FlexForce"><SOAP-ENV:Body><ns1:wsdlGetSchedulesV3Response xmlns:ns1="uri:FlexForce"><return xsi:type="tns:SchedulesV3Response"><schedules xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="tns:ScheduleV3[0]"></schedules><validationErrors xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[2]"><item xsi:type="xsd:string">Invalid fromDate: ${=def now = new Date();now.format("yyyy-mm-dd")}</item><item xsi:type="xsd:string">Invalid toDate: ${=def now = new Date();now.format("yyyy-mm-dd")}</item></validationErrors></return></ns1:wsdlGetSchedulesV3Response></SOAP-ENV:Body></SOAP-ENV:Envelope>