cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Stuti
New Member

Insert multiple records in Azure SQL table

Hi,

 

I new to Power Apps and struggling with trying to insert multiple records into Azure SQL.

I have a table with idkey, ticket number, state, city, option 1 and option 2.

Idkey is autogenerated

Ticket number, state, city are prepopulated in the table

Option 1 and Option2 are dropdown based values

Using power apps I want to select multiple tickets and add a new row with value for option 1 and option 2 alongwith current timestamp.

I have been using below logic it inserts new rows

creating a collection to capture check box - this gets the ticket numbers

on select of btn "Insert records" patch function as below:

Patch(
myTicketTable,
Defaults(myTicketTable),
{
Option_1: drpdwn_Option_1.Selected.Result,
Option_2: drpdwn_Option_2.Selected.Result,
Timestamp: DateTimeValue(Text(Now(),"[$-en-US] mm/dd/yyyy hh:mm:ss")),
UserName: User().FullName,
EmailAddress: User().Email}
);

It creates new records in the SQL table but,

1. inserts 739 (first ticket number) in column: ticket_number

2. State and City are blank

 

I know i am missing something please help me to figure it out.

Thanks in advance.

0 REPLIES 0

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,391)