How to get last week activities in GetStream - getstream-io

I would like to send an e-mail summary to all users every week or so with the latest activities. To do this, I would like to get the activities between two dates.
Is this possible?

There is no datetime filter, sorted recent as last by default. Simple read the feed while paginating and keep the part relevant to you.
Otherwise, you can push activities to week/monthly feeds with to targeting and then simply read these feeds for the respective week/month.

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.

Is there a way to use an IF statement to track if another user changed the data in a table and time stamp it?

I have an access database in which multiple customers will be placing large orders on a weekly basis. I have a query automatically set up in excel to refresh the information every minute. A potential issue I could see happening: Manager places order in our access form, decides to edit his record later w/o contacting the scheduler, and changes the order information he originally entered. I would like to track what it was changed from and to, as well as the date they changed it. These orders have to be placed by a certain time in the week for them to make the shipment in or out the following Monday. If orders are changed, I want to know. If orders are changed after the deadline, I especially want to know. Thanks
Create a before update event that inserts the changes into an audit log table. Here is the resource I used for my databases: https://www.techrepublic.com/article/a-simple-solution-for-tracking-changes-to-access-data/
Note: This will only track changes made to existing records through the form. It also will not track deletions or changes made directly in the table.

Is there a way to use Sharepoint version history to make a calculated column value?

I cannot see a way to do this natively, but essentially I would like to tap into the version history for a specific field value to calculate the difference between the current value and the last entered value.
Scenario:
Business user will update a numeric value in a column for each list item once a week to a cumulative amount. (i.e. Sales made to date)
I am currently able to see in the version history what the last entered value was, who entered it, and when it was entered. I want to know if there is a way to access this information in the form of a calculated column to find this difference (i.e. sales made this week). The solution I am thinking is adding another column for "Total Sales Last Week" and have the user manually update that when they update "Total Sales This Week" then have a calculated column to just subtract these values. However, this seems tedious since the information is already in Sharepoint. If there is a way to do this either with a calculated column, PowerAutomate flow or another method please let me know.
It is not possible to capture the Version History using calculated column. REST API is the only option that will be helpful to fetch these details. Considering this, there are two solutions that I can suggest here:
Using REST API
Create an additional column in your list and update it with the data that you will capture from version history using SharePoint REST API. Here, Rest API will be used to fetch the version history and also to update the list item.
As a trigger event to execute this code, Either you can setup a button on the page (if using any custom screen) or set this to execute periodically.
Using REST API in Power Automate (Recommended)
Power Automate/MS Flow doesn't provide any direct connector to fetch the version history but you can use the HTTP request connector which will help you to execute the SP rest call to fetch the version history.
Once you have version history data from your HTTP request call, you can use that to update the column in your list using the same power automate in next action.
This solution will be more useful as you don't need to setup any trigger event as mentioned in the first solution but instead of that you can simply configure this Power Automate to run as and when list item is updated and you will be having immediate result in your list.
You can refer to this link to check how to get data from HTTP request using Power automate and you can also refer to this link which will help you to understand how to get version history using SharePoint rest API.
I hope this will be useful information for you to achieve your goal.

How to filter Sharepoint list in Flow by current date plus days?

I've got a Sharepoint list tracking items and renewal dates associated with them. I want to utilize MS Flow to get just the items from that list (which will eventually have about 200 items in it) that have a renewal date 60 days from now, and send an email with the info from the list. This would recur every day.
The recurring feature works fine, as does the list and email.. My issue is with filtering the list down. I had hoped to be able to use views I created in the list, couldn't find a method for that, so I've resorted to attempting to utilize the ODATA filtering option.
I use the AddToTime feature before grabbing the list to get the 60 days out date (which is returning the correct value based on the error string), but no matter what I get invalid expression when it runs on the filter.
Any guidance on this?
This is Sharepoint Online and Flow Online. An example query string that I've used is Renewal_x0020_Date eq [insert the output from the Add to time flow item before].
RESOLVED!
Turns out, all I had to do was place single quotes around my object for the calculated date/time in my ODATA filter.

Data import from new reports and automatically update existing records in existing data

I seek expert advice of all of you in accomplishing my work related task.
Task : Task it to perform Analysis on reports obtained to WorkSafe Monthly and weekly and getting valuable information out.
For example :
Number of injuries on monthly basis drilled down by department and divisions.
Total days lost in year
Count of type of claims
Possible return date.
So i receive these reports and i add some modified columns to it. Like Correct employee names and their ID's just to create a relationship between Employee database in Powerpivot so that i could get their position, dept and division.
Now every month in new report there could be 2 or 3 new claims added to it, and some existing claims with updates info. like Updated return to work date, Short term disability days etc.
Currently i go through them manually and it's really time consuming and tiring. if there there was older claims weren't getting updates i could've just imported from a folder using power query and added steps to remove duplicates. However, if i remove duplicate claims using powerquery now, basically i'll be removing same claims with updated info.
Could anyone you here suggest an efficient way to do it with power query or with other approach?
Thanks in Advance. I'd appreciate your time and effort.
If you use PowerQuery and select your source From File -> From Folder, when you choose to combine and edit you will get a table with its first column named Source.Name; which you could use to differentiate the updates.
For instance: If I start with two excel files in the same folder (theoretically, they could be different date source files for you)...
WS1.xlsx:
WS1 - Copy.xlsx:
Then I use the folder they are both in as the source...
(Navigate to your folder as appropriate.)
...and select Combine & Edit...
...and select the worksheet...
Then I get this:
...and it is clear what information came from what source file.

Resources