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

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~

Related

delay until function in azure logic apps throwing error

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:

Checking file count returned by getmetadata activity in Azure data factory

How to get how many file names/folder names are returned by getmetadata activity in Azure data factory?
I want to get the number of files/folders returned by getmetadata activity and on the basis of this count decide which activities will execute..
Anyone have any idea about how can we get this count?
Thanks to those who commented and special thanks to Steve Zhao.
Actually i wanted to check if files present i.e length is greater than 0 then go to flow A else Choose flow B.
I've tried standalone greater and length function in my expression (greater(length(activity('GETFILENAMESFROMBLOB').output.childitems), 0)) to calculate length but when child items are 0 but when i tried this previous activity i.e GETMETADATA doesn't contains childitems array in it's output so my If condition activity gives error that property childitems doesn't exist.
I also tried empty function but the main issue was when there are no input files for getmetadata then we should not expect a childitems array in it's output.
So here is how i have solved the problem, at first i checked if childitems array is present in output of my getmetadata activity, then we'll get the actual count using length function else expression will have to return 0. Below is the expression used for if condition Activity. Please check.
Expression:
#if( contains(activity('GETFILENAMESFROMBLOB').output,'childitems'), length(activity('GETFILENAMESFROMBLOB').output.childitems), equals(2,3))
Hope this may help you!
Please try something like this:
The screenshots of pipeline:
Setting of Get Metadata1
Setting of If Condition1
Expression:#greater(length(activity('Get
Metadata1').output.childItems),100)
Hope this can help you:).
Below Code in IF condition Activities expression should be suffice for filecount > 0 logic.
#greater(string(length(activity('Get Metadata1').output.childitems)),'0')

debug and breakpoint print parameters as alert in ADF

I have an pipeline where i am calling other pipeline.
I want to see the values passed and the action happening when i debug.
In the below, during debug, i want to see what is the value sent with breakpoints for each flow of parameters and also want to see the PL_Purge Folder in action with debug
!PIPELINE PURGE]1
How to do it,. can you share some links
I think you have the only option to use the set variable activity and assign the value #item().XXXX . When you do that & run the pipeline you will be able to values at the pipeline output tab , nothing like a break point in a IDE , but since you have only 4 inputs which you are tracking this should be doable .
Please do let me know how it goes .

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

How can I make cucumber run all the steps (not skip them) even if one of them fails?

I am using Cucumber with RubyMine, and I have a scenario with steps that verify some special controls from a form (I am using cucumber for automation testing). The controls don't have anything to do with each other, and there is no reason for the steps to be skipped if one in front of them fails.
Does anyone know what configurations or commands should I use to run all the steps in a scenario even if they all fail?
I think the only way to achieve desired behavior (which is quite uncommon) is to define custom steps and catch exceptions in it yourself. According to cucumber wiki step is failed if it raises an error. Almost all default steps raise error if they can't find or interact with an element on the page. If you'll catch this exceptions the step will be marked as passed, but in rescue you can provide custom output. Also I recommend you to carefully define exceptions you want to catch, I think if you're Ok if selenium can't find an element on the page rescue only from ElementNotFound exceptions, don't catch all exceptions.
I've seen a lot of threads on the Web about people wanting to continue steps execution if one failed.
I've discussed with Cucumber developers: they think this is a bad idea: https://groups.google.com/forum/#!topic/cukes/xTqSyR1qvSc
Many times, scenarios can be reworked to avoid this need: scenarios must be split into several smaller and independent scenarios, or several checks can be aggregated into one, providing a more human scenario and a less script-like scenario.
But if you REALLY need this feature, like our project do, we've done a fork of Cucumber-JVM.
This fork let you annotate steps so that when they fail with a determined exception, they will let let next steps execute anyway (and the step itself is marked as failed).
The fork is available here:
https://github.com/slaout/cucumber-jvm/tree/continue-next-steps-for-exceptions-1.2.4
It's published on the OSSRH Maven repository.
See the README.md for usage, explanation screenshot and Maven dependency.
It's only available for the Java language, tough: any help is welcome to adapt the code to Ruby, for instance. I don't think it will be a lot of work.
The question is old, but hopefully this will be helpful. What I'm doing feels kind of "wrong", but it works. In your web steps, if you want to keep going, you have to catch exceptions. I'm doing that primarily to add helpful failure messages. I'm checking a table full of values that are identified in Cucumber with a table having a bunch of rows like:
Then my result should be:
| Row Identifier | Column Identifier | Subcolum Identifier | $1,247.50 |
where the identifiers make sense in the application domain, and name a specific cell in the results table in a human-friendly way. I have helpers that convert the human identifiers to DOM IDs, which are used to first check whether the row I'm looking for exists at all, then look for the specific value in a cell in that row. The default failure message for a missing row is clear enough for me (expected to find css "tr#my_specific_dom_id" but there were no matches). But the failure message for checking specific text in a cell is completely unhelpful. So I made a step that catches the exception and uses the Cucumber step info and some element searching to get a good failure message:
Then /^my application domain results should be:$/ do |table|
table.rows.each do |row|
row_id = dom_id_for(row[0])
cell_id = dom_id_for(row[0], row[1], row[2])
page.should have_css "tr##{row_id}"
begin
page.should have_xpath("//td[#id='#{cell_id}'][text()=\"#{row[3].strip.lstrip}\"]")
rescue Capybara::ExpectationNotMet => exception
# find returns a Capybara::Element, native returns a Selenium::WebDriver::Element
contents = find(:xpath, "//td[#id='#{cell_id}']").native.text
puts "Expected #{ row[3] } for #{ row[0,2].join(' ') } but found #{ contents } instead."
#step_failures_were_rescued = true
end
end
end
Then I define a hook in features/support/hooks.rb like:
After do |scenario|
unless scenario.failed?
raise Capybara::ExpectationNotMet if #step_failures_were_rescued
end
end
This makes the overall scenario fail, but it masks the step failure from Cucumber, so all the step results are green, including the ones that aren't right. You have to see the scenario failure, then look back at the messages to see what failed. This seems kind of "bad" to me, but it works. It's WAY more convenient in my case to get the expected and found values listed in a domain-friendly context for the whole table I'm checking, rather than to get a message like "I looked for "$123.45" but I couldn't find it." There might be a better way to do this using the Capybara "within" method. This is the best I've come up with so far though.

Resources