Tuesday, November 27, 2018

Screen Recorder as a GIF file



Just found one excellent tool to make screen recorder as a gif. It will capture your curser movement and create one GIF file. Here is the Link: https://www.screentogif.com/

Fantastic tool to create tutorial videos or may be steps to reproduce one bug etc.

Wednesday, April 25, 2018

How to use CAML Query in PowerShell to excute any operation

If you want to delete (or any operation) multiple Items from a list based on certain condition then you can refer below PowerShell command where we can use CAML query to get exact items which we need to delete. Most of the time I found that the developers write PowerShell command which get all the items then Check the condition and delete the items. If you have large number items in list then it will get much time to execute.

Add-PSSnapin Microsoft.SharePoint.Powershell -ea SilentlyContinue
$web = get-spweb "[Site URL]"
$list = $web.lists["List Name"]
$ValueToCompare = "[Value To Compare]"
$FieldToCompare = "[Field Name To Compare]"
$query = New-Object Microsoft.SharePoint.SPQuery
$query.ViewAttributes = "Scope='Recursive'"
$query.RowLimit = 1000
$caml='<Where> <Eq> <FieldRef Name="'+$FieldToCompare+'" /><Value Type="Text">'+$ValueToCompare+'</Value> </Eq> </Where>'
Write-Host $caml
$query.Query = $caml
$query.ViewFields = "<FieldRef Name='ID'/>"
$query.ViewFieldsOnly = $true
do
{
  $listItems = $list.GetItems($query)
  $query.ListItemCollectionPosition = $listItems.ListItemCollectionPosition
  foreach($item in $listItems)
  {
    Write-Host "Deleting Item - $($item.Id)"
    $list.GetItemById($item.Id).delete()
  }
}
while ($query.ListItemCollectionPosition -ne $null)  


Sunday, April 15, 2018

How to copy text from image - The One Note Way

In my opinion One Note is one of the Powerful tool comes in Office package but we rarely use those features. Here is one example of that.

In my last project I was working on an auditing software where client asks us to refer another Android app which was in Dutch language. There were many text so I was feeling pretty lazy to type all the text and implement it in our new app. To overcome this problem, I had taken the following steps:


  1. Take a screenshot of the old app from your mobile.
  2. Copy the screenshot in the desktop.
  3. Open the Microsoft One Note.
  4. Click on Insert from top menu. Then click on picture.  
  1. Then right click on the picture and select “Copy text from Picture”
  1. Then right click on a blank area and paste it.
  1. Finally, you will get only text from it. Rarely I found any error in this process.

Tuesday, February 20, 2018

PowerApps: Change Color of the button on select event

Use Case: In a quiz app, you need to put three buttons and based on the value of the button, color should be change. It should look like:




Or:




So how you do this? First, you need to put three buttons. In the “OnSelect” event of the button, you need to write following code:
UpdateContext({M1Q1Btn1ColorFlag:!M1Q1Btn1ColorFlag, M1Q1Btn2ColorFlag:false, M1Q1Btn3ColorFlag:false, Q1Ans:Button3.Text})




In addition, the “Fill” property of the button you need to put:
If(M1Q1Btn1ColorFlag = true, RGBA(0, 255, 0, 1), RGBA(230, 230, 230, 1))




Similarly, you need to do for “No” button as follows -
OnSelect: UpdateContext({M1Q1Btn1ColorFlag:false, M1Q1Btn2ColorFlag:!M1Q1Btn2ColorFlag, M1Q1Btn3ColorFlag:false, Q1Ans:Button2.Text})
Fill: If(M1Q1Btn2ColorFlag = true, RGBA(255, 0, 0, 1), RGBA(230, 230, 230, 1))


After the placement of the Buttons, you can put one Label to keep the response from the user. Later you can hide this label and use it at the event of the Finish Button to send it to SharePoint list or Excel.