web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Apps
Unanswered

Power Apps

(0) ShareShare
ReportReport
Posted on by

I Created the App in Power Apps like Chat GPT using Custom Connector and Custom Connector created by API Key and Endpoint URL is these :- https://api.openai.com/v1/chat/completions then after the app is Created and  after that I have Created Database in SQL Server My SQL Server Name is :-W10-8GB-DEV-5\SQLEXPRESS and Database Name :- Master In that have Mainly 5 tables of SQL Connected Completion Usage, Conversations Message, Node, User.

 

Completion Usage have fields like :- [Id] UNIQUEIDENTIFIER NOT NULL PRIMARY KEY,[CompletionTokens] [int] NOT NULL, [PromptTokens] [int] NOT NULL, [TotalTokens] [int] NOT NULL)

 

User :-[Id] UNIQUEIDENTIFIER NOT NULL PRIMARY KEY, [UserName] [nvarchar](max) NULL, [Email] [nvarchar](max) NULL, [FirstName] [nvarchar](max) NULL, [LastName] [nvarchar](max) NULL)

 

Conversations :- [Id] UNIQUEIDENTIFIER NOT NULL PRIMARY KEY, [Title] [nvarchar](max) NOT NULL, [Created] [datetime2](7) NOT NULL DEFAULT(getutcdate()), [IsDeleted] [bit] NOT NULL, [SearchTokens] [nvarchar](max) NULL, [UserId] UNIQUEIDENTIFIER NULL REFERENCES [dbo].[User](Id))

 

Node :- [Id] UNIQUEIDENTIFIER NOT NULL PRIMARY KEY, [UserId] [nvarchar](max) NULL, [ParentId] UNIQUEIDENTIFIER NULL REFERENCES [dbo].[Node](Id), [ConversationId] UNIQUEIDENTIFIER NULL REFERENCES [dbo].[Conversations](Id))

 

Message :- [Id] UNIQUEIDENTIFIER NOT NULL PRIMARY KEY, [UserId] UNIQUEIDENTIFIER NULL REFERENCES [dbo].[User](Id), [Content] [varchar](max) NOT NULL, [NodeId] UNIQUEIDENTIFIER NOT NULL REFERENCES [dbo].[Node] ([Id]), [ConversationIdentifier] UNIQUEIDENTIFIER NULL REFERENCES [dbo].[Conversations](Id), [Role] [nvarchar](max) NULL, [Created] [datetime2](7) NULL DEFAULT(getutcdate()), [ParentId] UNIQUEIDENTIFIER NULL REFERENCES [dbo].[Message] ([Id]), [CompletionUsageId] UNIQUEIDENTIFIER NULL REFERENCES [dbo].[CompletionUsage] ([Id]))

 

so Now I want to store this Data in SQL Tables What user Conversation.

 

In These App There are Only one Screen in these I have Mainly 5 Controls One Gallery, One TextInput , one Icon .

 

In Gallery I Inserted Two Label and give me More Details about of Control Gallery Item Property :- colChat, Icon

onselect  :- Set(varResponse,ChatGPTConnector.ChatAPI("gpt-3.5-turbo",Collect(colChat,{role : "user", content : txtinputMessage.Text}))); Collect(colChat,First(varResponse.choices).message); Reset(txtinputMessage)

and the Label Inside Gallery one label Have Text Property is this :- ThisItem.Role and

Other label Text Property :- ThisItem.Content 

 

so  I want to store Data in SQL in Respective Columns. Please free to ask If you Have any Query in Understanding the Question and also Please Help me if You Have any Idea

Categories:
I have the same question (0)
  • ANB Profile Picture
    7,223 Super User 2025 Season 2 on at

    Hi Again! @Anonymous, Please confirm that these are transactional tables:

    Completion Usage

    User

    Conversations

    Node

    Message

     

    Also, how you want to save the data to table? I mean every time user click on enter icon or you want that it should be saved in one go (complete conversation)

     

    Also from where you will get Completion Usage information? Basically you need to use Patch function.

     

    Thanks,

    ANB

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard