HI, Im confusing myself - how can I patch a toggle button to SharePoint, any help would be great, thanks
Patch(
SPNAME,
Defaults(SPNAME),
{
NameTitle: If(
Toggle1.Value
"Fred",
"John"
)
}
Solved! Go to Solution.
Hi @mezcalbean ,
You are missing a comma after Toggle1.Value and a closing bracket at the end, but other than that, it should create a new record with either Fred or John in the field NameTitle in your List SPName.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
You are missing a closing bracket at the end of your code.
The rest of you code looks fine, what's the error? I've made some assumptions to the error and provided a tip below that may help.
When creating new records in SP you must include any REQUIRED fields in your Patch statement. Usually, Title is REQUIRED so your code should be
Patch(
SPNAME,
Defaults(SPNAME),
{
Title: "",
NameTitle: If(
Toggle1.Value
"Fred",
"John"
)
}
)
If you have any other REQUIRED fields, these must also be included. If you are just Updating a record, REQUIRED fields usually aren't needed.
Hi @mezcalbean ,
You are missing a comma after Toggle1.Value and a closing bracket at the end, but other than that, it should create a new record with either Fred or John in the field NameTitle in your List SPName.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
You are missing a closing bracket at the end of your code.
The rest of you code looks fine, what's the error? I've made some assumptions to the error and provided a tip below that may help.
When creating new records in SP you must include any REQUIRED fields in your Patch statement. Usually, Title is REQUIRED so your code should be
Patch(
SPNAME,
Defaults(SPNAME),
{
Title: "",
NameTitle: If(
Toggle1.Value
"Fred",
"John"
)
}
)
If you have any other REQUIRED fields, these must also be included. If you are just Updating a record, REQUIRED fields usually aren't needed.
Thank you @EddieE and @WarrenBelz for your reply - who do I give the accept solution too?
User | Count |
---|---|
261 | |
128 | |
99 | |
48 | |
47 |