For Each with internal activities Azure Datafactory - azure

Is there a way to send the number of times the cycle was executed?
that is, I have a For Each that executes an ExePipeline and it has 6 activities and only to the last activity I need to send it the number of times that the for each was executed.
at the end of For Each it shows how much data "ItemsCount" entered but I couldn't call that value in the last activity of the pipeline.
someone to help me thanks.

It may depend on what you're using for your items in the foreach activity.
But for example, if your foreach activity is looping over the content of a file that you have retrieved by a previous lookup activity - you can get the count of these items by for example:
#activity('Lookup activity name').output.count

Related

can some one help me create a Power Automate flow

A power automate flow triggered on a daily schedule will check the list for any tickets that meet (or exceed) due date and submit a ticket to Orion via email. The last run and due date will then be updated. The system may be used to trigger tickets in supplier interface in the future - the destination system should be considered in the list schema.
i am having a hard time to develop a flow that executes the above requirement.
In Power Automate, create a scheduled flow that runs every day.
Declare all variables you will need later.
Assuming you store the value of the last run timestamp in a configuration SharePoint list for example, search and use the action Get item to get the list item where the last run time is stored in this list (you're have to create it if not existing though).
Search and use the function utcNow() in an expression to get the current datetime value.
Convert the previous datetime value with the action Convert time zone to an ISO-8601 datetime using FormatDateTime() function according to your timezone.
Search and use the action Get list items to get all the items of day from your SharePoint list, and filter the query via an OData expression according to the rule (today's date =< last run date + frequency).
Search and use Send an email V2 to send email.
Search and use the action Update item to update the last run time that is stored in a list item in the configuration list mentionned at the beginning.

How terminate pipelines in Azure Synapse when query returns no rows

I have a pipeline A that is invoke by a main pipeline D. It invokes 2 other pipelines B and C. When pipeline A is invoked an extraction query is executed that can return rows or nothing.
In case it returns no rows I would like it to terminate without sending an error message.
It should also terminate the main pipeline D. In other words pipelines B and C shouldn’t be invoked.
How can I invoke such a terminal activity in Azure Synapse? I would like to avoid using a Fail activity as it would be a false negative.
Since your child pipeline has the look up output count, and there is direct way to pass the count to master pipeline, you can consider changing the pipeline configuration.
Instead of using lookup to get the count, you can directly use a copy data activity and write the count of records to a new table.
You can get this data (new table data) using look up in master pipeline and perform the check (whether count is 0 or not).
Look at the following demonstration. I have a table with no records in my azure SQL database. In Pipeline A, I have used the following query as source of copy data activity and auto created a table in sink.
-- in source. Querying the required table for count
select count(*) as count from demo
Now in master pipeline, use an additional lookup to read records from above created count_val table. The output will be as follows:
Now you can use this count in if condition using the following dynamic content:
#equals(activity('Lookup1').output.value[0].count,0)
The condition will be true when the count is 0 (as show below) and hence the flow stops (no activities inside true case). If there are records, then the next pipelines will be executed (false case).

Power Automate "Vlookup" using Sharepoint Lists - Vlookup resetting

I have the below "Vlookup" , When a record gets submitted in list "Template" I want that to reflect in the list "Aug2021"(Created from an excel sheet) in the "Submitted" column as a "Yes" or "No".
Lookup with between "Project ID" in Template, and "Title" in Aug2021.
IT works fine for the first record submission into "Template", The submitted column shows a "Yes" nicely within list "Aug2021" .
However when I submit a 2nd record, the vlookup resets and that first record will no go to a No. Why is this?
This is what I mean - the flow re runs based on the new record.
When Power Automate does not execute the branch I "think" it "should" execute, that always is because the condition is not met.
The only way to troubleshoot that is to look into what is actually being fed into the Condition. At least while you're still developing.
Initialise two variables at the top, one for the Title and one for the Project ID. Write the Project ID into the variable as soon as you have it. Write the Title into the variable before the Condition step.
Now you can see in the flow run what the values are and you can see the reason for the condition branch being executed.
Also note that the For Each loop will run on all records that are returned bye the Get Items step. This looks like it may write a lot of records that don't match the title.
Edit after comment: You say that the list Aug2021 has 2000 items. Are you attempting to loop through all of them in the flow? That won't work, because the Get Items command only returns a maximum of 100 items.
The flow run screenshot shows that it processed exactly 100 items in the Apply to Each loop. Your screenshot only shows the first one.
Unfortunately, you did not follow my recommendation for troubleshooting, so you still don't know which values are being fed into the condition for each instance of the Apply to Each loop.
If you don't follow advice, I have no idea what else to write.

How to use Azure Data Factory IF Activity?

I am getting value cnt=1 from my query in LookUp Activity.
Now I want to check if cnt value is 1 in IF activity then run another activity.
Finally, I found the solution.
Below is the working code for my problem:
#equals(activity('Lookup1').output.firstRow.cnt,1)

o365 graph api filter recurrance events

I'm trying to limit the results of O365 events to a range of dates. https://graph.microsoft.com/v1.0/me/events?$filter=Start/DateTime+le+'{0}T00:00:00.0000000'+and+(End/DateTime+ge+'{1}T00:00:00.0000000'). This works except for recurrence events. With those, the End/DateTime is the same as the start.
Every time I try to drill deeper (reference recurrence/range/endDate or recurrence/range/type) I get a 400 invalid request.
Even if I just try to reference 'Type' (Singleinstance, ...) to determine if it is a recurrence item, that gives me a 400.
For a test, I even just tried showAs+eq+'busy' and that gives me a 400.
Not sure what I am doing wrong, and why the parameters don't seem to match the case of the results you do get back.
Has anybody been able to limit the recurrence events to a range? I know that you still have to query the details with a start and end date so it automatically breaks them down for you, but I would still like to limit the volume that comes back from the initial query. Thanks
If you are looking to get a list of events for a given date range, you may be better off using calendarView instead of events.
The calendarView will return each appointment instance including any instances of a reoccurring event that occurs within the specified time frame. It also takes into account any exceptions to a reoccurring event (i.e. when a single occurrence in a series was cancelled or moved).
The events method only returns single instance appointments and reoccurring appointments who's master (i.e. first occurrence) was in the specified time frame.
The events method returns data aigned with how it is stored by Exchange where calendarView aligns with how the data is rendered by the client.
For example, the URI https://graph.microsoft.com/v1.0/me/calendar/calendarView?startDateTime=2016-06-09T00:00:00Z&endDateTime=2016-06-10T23:59:59Z will return every calendar entry for June 9th, 2016.

Resources