delay until function in azure logic apps throwing error - azure

I am trying to add a minute delay to the "delay until" action by getting the utcnow timestamp, adding a minute and converting into the time format that the "delay until" expects (https://learn.microsoft.com/en-us/azure/connectors/connectors-native-delay#add-the-delay-until-action)
None of the following works and throw the error below, what am i missing here, and is there a way where we can test these function independently without logic apps ?
1) #addMinutes(utcNow('o'),1,'YYYY-MM-DDThh:mm:ssZ')
2) #addMinutes(utcNow('YYYY-MM-DDThh:mm:ssZ'),1,'YYYY-MM-DDThh:mm:ssZ')
3) #addMinutes(utcNow(),1,'YYYY-MM-DDThh:mm:ssZ')
Unable to process template language expressions in action 'Delay_until' inputs at line '1' and column '2265': 'The string was not recognized as a valid DateTime. There is an unknown word starting at index 0.'.

Please try to use this expression:
addMinutes(utcNow(),1)
I did a test, it seems to be no problem:

Related

Able to access variable inside one if-statement but not other

Here's a snippet from my code and it's weird why I'm able to access the variable named 'calBegPoint ' inside 3rd if statement but not the second.
if graph != None:
for trace in graph['data']:
if 'LSR(' in trace['name']:
calBegPoint = trace['x'][0] #Statement 1
if '% change' in trace['name']:
print(calBegPoint) #Statement 2
if 'LSR Extended' in trace['name']:
print(calBegPoint) #Statement 3
When I run this code, I get the following error on Statement 2 but, if I comment it, I do not get the error for Statement 3. To solve, this problem, I tried declaring calBegPoint= "Hi" before the entire snippet. With that I did not get the error but, the value printed on Statement 2 was 'Hi' and not the one I calculated.
I've been trying to debug it for hours. Any direction/pointer will be appreciated
UnboundLocalError: local variable 'calBegPoint' referenced before assignment
The error message tries to tell you that you use calBegPoint before defining it.
In your case, the first execution of the second or third if statement lies before the first execution of the first if statement.

Logic APP : ActionFailed. An action failed. No dependent actions succeeded

I am facing the issue with for loop execution with logic APP in azure. Apparently complete playbook execute successfully and functionally its working good. However, i am getting this error because it takes "body" parameter from previous step as input and nothing else. The body is long json and therefore should not be the right input for foreach loop. I tried adding account or Ip address as input but that fails as well.
Input
Output
Please help here
As you mentioned there is just one item in your json data array which contains "MachineId", I assume the first item contains "MachineId". Please refer to the solution below, it will help you to use the only "MachineId" in the 24 cycles of your loop.
We can input an expression to use the "MachineId" in first item:
body('Parse_JSON')[0].MachineId
(In the screenshot above, I just use a "Set variable" to replace your two actions in "For each" loop, but I think there is no difference between them)
Please have a try with this solution~

Dynamically passing a row number to Session.findbyid method

I am trying to write a script which posts invoices in SAP through Excel (fairly new to this), and am running into the following error:
"The control could not be found by id".
The error is coming up at the below line:
session.FindById("wnd[0]/usr/subITEMS:SAPLFSKB:0100/tblSAPLFSKBTABLE/ctxtACGL_ITEM-HKONT[1,w_counter]").Text = w_glacc
Here, I am trying to pass the GL account number in the first row. There can be multiple rows, so I was hoping that instead of passing ctxtACGL_ITEM-HKONT[1,0]").Text, ctxtACGL_ITEM-HKONT[1,1]").Text etc. I wanted to initialize a counter and pass that value into this method.
Is there any way this can be achieved?
Found a solution:
Instead of passing just w_counter I had to pass "&w_counter&".
Previously, code was:
session.FindById("wnd[0]/usr/subITEMS:SAPLFSKB:0100/tblSAPLFSKBTABLE/ctxtACGL_ITEM-HKONT[1,w_counter]").Text = w_glacc
Now, it is:
session.FindById("wnd[0]/usr/subITEMS:SAPLFSKB:0100/tblSAPLFSKBTABLE/ctxtACGL_ITEM-HKONT[1,"& w_counter &"]").Text = w_glacc

VBF syntax for SSRS expression cannot figure out proper construct

looking for help on what should be a very basic function. I am trying to get a SUM of a specific value, however I do not seem to get the syntax correct.
Here is what I have
=Sum(Fields!PriorYearSalesDollars.Value - Sum(Fields!PriorYearCost.Value
+Sum(Fields!PriorYearFrtCost.Value)))
However I get an error when trying to sum. Is there another way to test this also? Each time I modify the expression I then have to save the report and upload to the report server and test again. If I do it through the preview function in visual studio it throws a generic error on the whole report. When running from report server, just this specific column shows #Error
This is the syntax that works after FIRST changing the column format to numbers where I accidentally did it as currency first. Not sure why currency didn't work, but this is correct.
=Sum(Fields!PriorYearSalesDollars.Value) - (Sum(Fields!PriorYearCost.Value) + Sum(Fields!PriorYearFrtCost.Value))

Azure data factory slicestart format error

I've been trying to set in SELECT parameter - slicestart time to gather just lately changed records:
WHERE pv.CreatedAt >= \\'{0:yyyyMMdd-HH}\\'', Time.AddHours(SliceStart, 0))"
and I got error:
Database operation failed. Error message from database execution :
ErrorCode=FailedDbOperation,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=A
database operation failed with the following error: 'Conversion failed
when converting date and/or time from character
string.',Source=,''Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=A
database operation failed with the following error: 'Conversion failed
when converting date and/or time from character
string.',Source=Microsoft.DataTransfer.ClientLibrary,''Type=System.Data.SqlClient.SqlException,Message=Conversion
failed when converting date and/or time from character
string.,Source=.Net SqlClient Data Provider,SqlErrorNumber=241,'.
I see you are using the Time.AddHours() function but passing 0 as a parameter which would add zero hours to the SliceStart value. If you did not intend to increment the SliceStart time try the following:
"sqlReaderQuery": "$$Text.Format('select ... where pv.CreatedAt >= \'{0:yyyy-MM-dd}\', SliceStart)"
Cheers,
Luis
In addition to what #Luis answer.
You have to make sure that the source date format must match the format of date being passed.
For eg:- If the source is Oracle then write query as below:-
WHERE TO_DATE(pv.CreatedAt,'YYYY-MM-DD') >= \\'{0:yyyy-MM-dd}\\'',SliceStart))"

Resources