Hi,
I am trying to submit a new record into SQL server which required a GUID. function. I tried inserting a default value in the datacard with the value GUID() but I receive an error that the AccountID is required.
I tried the following Patch function but keep receiving the following errors (Unexpected characters: Contain 'ParenClose' where Error is expected):
Patch(
'[dbo].[Account]', Defaults('[dbo].[Account]'),
{
Name: DataCardValue20_2.text,
Surname: DataCardValue38_2.text,
Group: DataCardValue4_2.text,
Passport No: DataCardValue36_2.text,
Tel No: DataCardValue39_2.text,
Cell No: DataCardValue2_2.text,
ID No: DataCardValue5_2.text,
Nationality: DataCardValue21_2.text,
Relationship: DataCardValue37_2.text,
Email Address: DataCardValue3_2.text,
Initials: DataCardValue19_2.text,
Notes: DataCardValue35_2.text,
AccountID: GUID()
}
)
What could be the problem with the above Patch statement? Is there any other way to submit a new record with GUID?
Thanks in advance.
Hi @wschel
Part of the problem is that for column names with spaces, you need to enclose the column names in single quotes. The column names are also case sensitive, so the names you provide will need to match the case of your source columns.
The following should hopefully take you further.
Patch(
'[dbo].[Account]',
Defaults('[dbo].[Account]'),
{
Name: DataCardValue20_2.Text,
Surname: DataCardValue38_2.Text,
Group: DataCardValue4_2.Text,
Passport No: DataCardValue36_2.Text,
'Tel No': DataCardValue39_2.Text,
'Cell No': DataCardValue2_2.Text,
'ID No': DataCardValue5_2.Text,
Nationality: DataCardValue21_2.Text,
Relationship: DataCardValue37_2.Text,
'Email Address': DataCardValue3_2.Text,
Initials: DataCardValue19_2.Text,
Notes: DataCardValue35_2.Text,
AccountID: GUID()
}
)
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
207 | |
188 | |
80 | |
50 | |
38 |
User | Count |
---|---|
305 | |
255 | |
121 | |
73 | |
56 |