0

Rather than POSTing a static date in SOAP request <fromDate xsi:type="xsd:string">2022-01-01</fromDate>

I am POSTing a relative date in the format below in SOAP request. It works perfectly in SOAPUI but fails in PowerAutomate flow. Any idea as to why or an alternative to my issue.

<fromDate xsi:type="xsd:string">${=def now = new Date();now.format("yyyy-MM-dd")}</fromDate>

1 Answers1

0

I'm not exactly sure what and where you're doing this but the correct expression within PowerAutomate/LogicApps would be something like this ...

@{formatDateTime(convertTimeZone(utcNow(), 'UTC', 'AUS Eastern Standard Time'), 'yyyy-MM-dd')}

... so to give you an example, setting the value of a variable like this ...

<fromDate xsi:type=\"xsd:string\">@{formatDateTime(convertTimeZone(utcNow(), 'UTC', 'AUS Eastern Standard Time'), 'yyyy-MM-dd')}</fromDate>

XML

... will produce this result.

Result

You can also see that I've converted the UTC date/time to the time zone I'm in to give me exactly what I want.

Skin
  • 9,085
  • 2
  • 13
  • 29