Wednesday, December 25, 2024

Show all data of HTTP rest API request in Copilot agent

 Hello,

Suppose if you're making any HTTP call e.g. any API which is returning number of records then using Generative answers it will display summary of first 3 records. To overcome such situation follow below steps to show all records in UI.

  1. Make HTTP API call



  2. Parse response in another variable





  3. Create one new topic which has logic related to For Each. In that add logic to show record as per data. Make sure kind:Foreach in order to looping.

**{Topic.varListingRecord.name}**<br> Address: {Topic.varListingRecord.address1} {Topic.varListingRecord.address2} <br>{Topic.varListingRecord.city} {Topic.varListingRecord.province} {Topic.varListingRecord.country} {Topic.varListingRecord.postalZip}<br>Listing Type: {Topic.varListingRecord.listingType} <br>Timezone: {Topic.varListingRecord.timezone} <br>Currency: {Topic.varListingRecord.displayCurrency} {First(Topic.varListingRecord.rates).pricePerNight} <br> {Topic.varListingRecord.externalUrl} {Topic.varListingRecord.facebook} {Topic.varListingRecord.twitter} {Topic.varListingRecord.google} <br>{Topic.varListingRecord.propertyDescription}


  1. Will get output like this where it will display all data but here included only single record in snap.




Saturday, December 21, 2024

Pass variable/session/cookie data from website to CoPilot agent topic

Hello friends,

Here I'm sharing step by step information how can we pass any application variables e.g. cookie/session data from custom website to CoPilot agent topic.

Go to Conversation Start topic and add variable like below make sure to set variable properties Global > External sources can set values.


In this example I've integrated CoPilot agent in .Net core 8.0 web application. So in page where you're calling agent over there pass those variable values as Iframe querystring.

After it you can see able to access page variable values in CoPilot agent.











Wednesday, April 14, 2021

Load default image if src image does not exist

 Hello Team,

Many times you noticed while we're binding image which comes from database or from cloud and if image does not exist then it's showing missing image like below screenshot. 

To overcome such situation add onerror attribute and assign default image path.

e.g.



<img src="@imagePath" onerror="this.src='../images/default-image.png'">

Tuesday, August 27, 2019

Schedule SQL Jobs in Azure


Hello Guys,


Here I'm providing link from where you will get step by step information in order to schedule SQL job in Azure.

https://www.netwoven.com/2017/12/12/schedule-execution-sql-jobs-azure-automation-service/

Workflow to call Stored procedure e.g.

workflow RB_Daily_Job
{
Write-Output('RB_Daily_Job job starting.')
Write-Output('Job is calling UpdateStatus SP.')
$dataTable = RB_Record_AzureScheduler -sqlServer 'dbtest.database.windows.net' -Database 'dbTest' -SprocName 'UpdateStatus' -Parameters '' -SqlCredentialName 'SQLDBCredential'
Write-Output('('RB_Daily_Job  job executed successfully.')
}

Thanks

Thursday, February 28, 2019

Build Proactive Bot


Hello techies,

Here I'm sharing a link to know how Proactive BOT is working.

https://www.youtube.com/watch?v=Am1NPUceFvA&t=1s








Friday, January 11, 2019

Send SMS using Twilio API in C#

Hello Friends,

Here, I'm providing link to send SMS using Twilio API in C#.

https://www.twilio.com/docs/sms/quickstart/csharp-dotnet-core#sign-up-for-twilio-and-get-a-twilio-phone-number

Twilio API has all the features to know status of SMS & it's very easy to integrate in application.

Thanks

Integrate Bootstrap Full year calendar control

Hello Friends,

Here, I'm providing links where we've all the information to integrate Bootstrap Full year calendar control.

This control has all inbuilt functionality like.

  • Show event information on tooltip
  • Show booked event with different background color
  • Open modal pop-up to add event data

Feel free to reach me if you face any difficulty while integrating it.

Thanks

Friday, January 4, 2019

Paste JSON As Class Or XML As Class in Visual Studio

Hello Friends,

In this article I'm explaining how we can quickly create class entities from json/xml data.

let's consider we've below JSON data based on it we've to generate class with same entity name.



How to generate class within Visual Studio


Step 1: Create a blank class



Step 2: Delete high lighted code. And keep your cursor inside namespace curly braces



Step 3: Open menu as per high lighted sub menu



Step 4 : Paste JSON code in class


Here you can see your JSON data have been converted into class. You can follow same step to paste XML As Class convert.

Friday, July 13, 2012

OpenRowset in 32 bit Operation system

Hello Friends, 

If you face the error like below while use "OpenRowset" in Sql server 2008 using the 32 bit Operation system. 

Error : OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" returned message "Unspecified error". Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)". Than follow the below steps :

1) Go to the SQL Server Management studio --> Server Objects--> Linked Server --> Providers --> Microsoft.ACE.OLEDB.12.0 

2) Right click on "Microsoft.ACE.OLEDB.12.0" and goes to Properties --> Uncheck the checkbox of "Allow in Process". 

Please note this solution is for 32 bit operating system. :)  

Regards 
Jignesh Patel

Monday, December 26, 2011

Get Stored Procedure name by using table name in Sql Server

Hello Friends,

Find the below two query for get Stored Procedure list by using table name.


SELECT ROUTINE_NAME, ROUTINE_DEFINITION
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_DEFINITION LIKE '%Nameoftable%'
AND ROUTINE_TYPE='PROCEDURE'


SELECT DISTINCT o.name, o.xtype
FROM syscomments c
INNER JOIN sysobjects o ON c.id=o.id
WHERE xtype = 'P' and c.TEXT LIKE '%Nameoftable%'

Friday, August 5, 2011

WCF hosting types

Hello Friends,

Find the below link for different ways to host the WCF Service.

Click here

follow the all the step u will get it done.....

Enjoy wih WCF.

Friday, July 8, 2011

Create Windows Service

Hello Friends,

Find the below link for create the windows service by using simple step.

Click here

happy coding...

Thursday, June 16, 2011

Scheduling and Event Logging Windows Service

Hello Guys,

Now u can create windows service with some easy step.
Also u create can "Scheduling Windows Service with Timer Control".

http://www.aspnetajaxtutorials.com/2008/01/create-windows-service-with-cnet-part-2.html

Create CSV file in Asp.Net

Hello Friends,

U can create CSV file using below code.
Call below GetRecord() function in your button click event or wherver u need.
Folder name and file name will be get from .config file.

Sub GetRecord()
Dim dt As DataTable
Dim Id As Integer
Id = Convert.ToInt32(ConfigurationSettings.AppSettings("Id").ToString())
Dim ds As DataSet = SqlHelper.ExecuteDataset(sConnString, "Get_Record", Id)
Dim headers(ds.Tables(0).Columns.Count) As String
Dim cnt As Integer = 0
For Each column As DataColumn In ds.Tables(0).Columns
headers(cnt) = column.ColumnName
cnt = cnt + 1
Next
ExportCSV(ds, 0, headers)
End Sub

Sub ExportCSV(ByRef ds As DataSet, ByVal tableIndex As Int32, ByRef headers As String())
'Write out column headers
Dim headerOut As String = ""
If Not headers Is Nothing Then

For i As Integer = 0 To headers.Length - 2 'Don't do the last item yet
headerOut += headers(i)
headerOut += ","
Next
headerOut += headers(headers.Length - 1) 'Now do the last item, so you don't have a trailing comma.
'CSVWriter.WriteLine(headerOut)
End If
headerOut += Environment.NewLine

'Write out data
Dim CSVOut As String = ""
For Each r As DataRow In ds.Tables(tableIndex).Rows
For i As Integer = 0 To (ds.Tables(tableIndex).Columns.Count - 2) 'Don't do the last item yet
If Not IsDBNull(r(i)) Then
CSVOut += Chr(34)
CSVOut += CStr(r(i))
CSVOut += Chr(34)
End If
CSVOut += ","
Next
If Not IsDBNull(r(ds.Tables(tableIndex).Columns.Count - 1)) Then
CSVOut += CStr(r(ds.Tables(tableIndex).Columns.Count - 1)) 'Now do the last item, so you don't have a trailing comma.
End If
CSVOut += Environment.NewLine
'CSVWriter.WriteLine(CSVOut)
Next

Dim sFileName As String = ConfigurationSettings.AppSettings("FileName").ToString()
Dim dtTime As DateTime
dtTime = DateTime.Now()
Dim swOut As New StreamWriter(sADPOut + "\" + sFileName & "_" & dtTime.ToString.Replace("/", "").Replace(":", "") + ".csv")
swOut.Write(headerOut.ToString())
swOut.Write(CSVOut.ToString())
swOut.Flush()
swOut.Close()

End Sub

.CSV file will be save in specified folder.

Sunday, December 6, 2009

Open div tag layer in Javascript

Hello Friends

Please find the below javascript script for open the div base layer on the screen.


/*function showBox()
{
var width = document.documentElement.clientWidth + document.documentElement.scrollLeft;


var layer = document.createElement('div');
layer.style.zIndex = 2;
layer.id = 'layer';
layer.style.position = 'absolute';
layer.style.top = '0px';
layer.style.left = '0px';
if(document.documentElement.scrollHeight < 800 )
{
layer.style.height = 835 + 'px';
}
else
{
layer.style.height = document.documentElement.scrollHeight + 'px';
}

layer.style.width = width + 'px';
layer.style.backgroundColor = 'black';
layer.style.opacity = '.6';
layer.style.filter += ("progid:DXImageTransform.Microsoft.Alpha(opacity=60)");
document.body.appendChild(layer);

var div = document.createElement('div');
div.style.zIndex = 3;
div.id = 'box';
div.style.position = (navigator.userAgent.indexOf('MSIE 6') > -1) ? 'absolute' : 'fixed';
div.style.top = '200px';
div.style.left = (width / 2) - (400 / 2) + 'px';
div.style.height = '150px';
div.style.width = '500px';
div.style.backgroundColor = 'white';
div.style.border = '2px solid silver';
div.style.padding = '20px';
document.body.appendChild(div);

var a = document.createElement('div');
a.innerHTML = '
';

div.appendChild(a);
var divSub = document.createElement('div');
divSub.innerHTML = '

Under Construction

';
div.appendChild(divSub);

}
function removelayer()
{
document.body.removeChild(document.getElementById('layer'));
document.body.removeChild(document.getElementById('box'));
};


Call the above script using
opendivlayer */

Add close.jpg image in your root directory.

Thanks & Regards
Jignesh Patel

Wednesday, December 2, 2009

Application folder in Asp.Net

Hello Friends

Go through the below link for get good knowledge of application folder in Asp.Net.

http://www.codeproject.com/KB/aspnet/AspNetAppFolder.aspx

Tuesday, October 13, 2009

User Creation and Role Assignment in Dotnetnuke

Hello Friends

Go through the below link for create user and role assignment in Dotnetnuke(DNN)

http://www.codeproject.com/KB/aspnet/DNNRolesnUser.aspx

Thursday, October 8, 2009

Login in dotnetnuke

Hello friends

You r in trouble with login in dotnetnuke web site.

So login in your DNN web site just add the "?ctl=login" in any page.

suppose your web site name is "http://www.test.com"

than u can login in that using "http://www.test.com/Default.aspx?ctl=login"

Thursday, October 1, 2009

Increase dotnetnuke website performance

Hello Guys

Go through below way for increase dotnetnuke web site performance

(1)If your DotnetNuke website is running slow. You can increase it’s performance by deleting it’s logs. To do that, please login to your dotnetnuke site as HOST. Then go to "Admin" --> "Log Viewer". Then in the log viewer page , "Delete all selected exceptions" and "Clear log" link at the bottom of page Clear all your logs will increase your dotnetnuke performance. Another faster way would be connecting to your Dotnetnuke db directly and run the following SQL command:

delete from eventlog;

(2)Extra caching (Not in the menu)

Although the above caching options let you decide if you want Dotnetnuke to offer caching there is something extra you can do. This will require you to edit your ascx skin files. Open your skinfile and add the following script:

Tuesday, September 22, 2009

Open popup in button click event

Hello guys

Add below C# code in button click event.

StringBuilder sb = new StringBuilder();
sb.Append("");
System.Web.UI.ScriptManager.RegisterStartupScript(this.upnlStd, this.GetType(), "sb", sb.ToString(), false);