Tuesday, December 12, 2023

Build JSON object in Power Automate

We often create custom JSON objects and pass them to an action or through a web request body. For instance, let’s consider a ‘Create item’ action. If we need to build properties, we can simply configure the JSON object in the ‘item’ section, as shown in the screenshot below.


The JSON object configured above works fine as long as the values don’t have any special characters that affect the JSON object structure. However, if the title variable contains a double quote (”), the flow would fail as the JSON structure would be disturbed.

A better alternative to fix the issue mentioned above is to use the ‘Select’ action and build the JSON object as shown in the image below. This action would take care of escaping all the special characters associated with JSON. Refer to below screenshot for building JSON with select action.


To use the object constructed in ‘Select’, refer to the 0th element from the body of the ‘Select’ output, as the ‘Select’ action would always have an array.


This approach is recommended only when JSON object values may contain special characters.


Friday, January 6, 2023

PowerApps to PowerAutomate Integration - Connections!!

 When we integrate Power Automate flow with a PowerApp, by default the connections configured (run by user's) at powerapps will be passed on to Flow. 

For example, if we send email through Flow and its configured using service account, but when  the flow triggered from PowerApp, it passes the App running user's connection and email would be going from the user's account, not service account.  Similar thing would happen for other connections too.

There might be cases where we don't want this and the solution we follow in general is create a child flow and pass params to it from the main flow. Child flow uses configured connections as no connections are passed on to child flow.

But now, we do have much easier solution to this problem. It is with PowerApps V2 trigger. 

Using this new trigger, we get the ability to Impersonate actions / run activities with different user from Power Apps.

Once a flow is configured using new trigger, on the detail page, to the left bottom we would see "Run only Users" section. Click on Edit

This will provide option to update the connections to use for each type of connected we configured. By default they are set to "run-only user". We can change it to the connections we have in the flow.  


With this, for above example all emails triggered would be from service account only. We can repurpose this for other type of connections too like inserting data to SharePoint / read data from SharePoint even though end user doesn't have access on it.







Wednesday, January 4, 2023

Sharepoint Online Migration Considerations!

 Below are some of aspects to consider when we migrate a Sharepoint on Prem to Online. 

  • Checked out versions of the files won't migrate. Last checked in version will move during migration
  • If the file doesn't have any checked in version, it won't migrate. Need to consider this for files count match after migration
  • For files with no checked in version, we can check in using admin account by following "Go to the Document Library Settings and click on "Manage files which have no checked in version". You can manage the checked out files here to force check out it to yourself, then check it in."
  • Alerts wont be migrated, need to reconfigure them online
  • Personal Views / Personalized page customizations won't migrate, except the ones created using the migrating account, if any
  • Item versions would cause issue during migration if there is any change in required fields, like we have 100 records with no title, but later title made required . In this case, we need to remove required setting on fields, migrate content and then enable required fields
  • In online, we have only 2 templates and during migration all templates would be converted to any of these. But, we may loose some inbuilt features of the templates like Blogs
  • Any Page customizations / custom layouts may be set to default ones after migration. We need to rearrange them
  • Lists with huge content (more than 5k records) and views with many fields (containing 12+ lookup columns) would cause threshold errors. Need to update views & filters to look into the content 
  • Sharepoint links in general auto updated to point to new site, during this process if the url crosses 255 characters, it gives error. Need to fix them