Posts

Showing posts from May, 2021

Moving PowerApps Attachments to a SharePoint Library using Power Automate flow.

Image
  Use Case :  Move the attached files to a SharePoint library rather than saving them as a SharePoint list item attachment. Solution: A gain the simplest solution is to create a Power Automate flow which runs on items creation. Add the action "Get Attachments" This will take in Site Address, List Name and the ID of the recently created item. So the catch is to add this action just after the When an item is created or modified step. Then we need to add the Get Attachment Content action. This action is also straight forward, it again takes in your address list name, ID and a File Identifier. The File Identifier is nothing but the Id for the previous step. Also, as soon you add it, Apply to each will wrap it. Next step is to add Create file action. This is again straight forward, just provide the Address, Folder Path (basically the SharePoint library you wish to save your attachment.), File Name and the File content.  File content is the output of your previous step. And thats i

Bulk Ops in Power Apps

Image
Scenario: User wants bulk operations like status change to multiple items in Power Apps. The data for this is saved in SharePoint online lists or Data verse. So first thing first, let just design a simple app. Our app will have a gallery on the screen, this gallery will be linked to a SharePoint online list. Then we will add checkbox field in the gallery and also put in few labels to show data values of the respective list. Next we need to go to the OnCheck property of this checkbox control. Here what we will do is create a collection and add the selected item on it. Code for this will look something like this Collect(collectionName, ThisItem) Similarly, we will now proceed to the OnUncheck property code for it will look something like  Remove(collectionName,ThisItem). So what we are trying to do in here is that on check of the checkbox we are adding the selected item from the gallery into your collection, named as collectionName in above code. Next we add two button on the screen, in

A type named 'SP.Data.TestListListItem' could not be resolved by the model. When a model is available, each type name must resolve to a valid type.

Image
 Scenario: Trying to update a SharePoint list item using Send an HTTP request to Sharepoint action in Power Automate. This is an exception case, and i am writing it only to save someone's else time. Normally we can use Power Automate to GET, POST, PATCH & DELETE sharepoint list items. There are standard syntax, you need to follow to do it. The above title is an exception when your list name has a space when you create it. But when you delete that space later your Send HTTP request to SharePoint starts giving an error.  To be more clear i had a list called Master_Timesheet. And all i was doing was calling a flow from a Power App button and passing the listitem ID as parameter to the flow Something like this. FlowName.Run(ThisItem.ID) But to my surprise i was getting the below error. A type named 'SP.Data.Master_TimesheetListItem' could not be resolved by the model. When a model is available, each type name must resolve to a valid type. Initially i thought that i must hav