admin管理员组文章数量:1353265
I am to create an address collection form for my work team. How do I make it so that when someone on my team submits their data it will create a new entry and if it there is an existing entry, then it will update the previous entry?
I like to make it so that the work "alias" box is used a reference to determine if there is an existing entry.
Currently, my formula to create new entries is:
Patch(
'Shipping Form',
Defaults('Shipping Form'),
{
'First Name': firstnameinput.Text,
'Last Name':lastnameinput.Text,
'Alias':aliasinput.Text,
'Address Line 1':addressline1input.Text,
'Address Line 2':addressline2input.Text,
'State/Province':stateinput.Text,
'Zip/Postal Code':zipinput.Text,
'City/Region':cityinput.Text,
'Permission to share to Reporting Manger if needed?':'Perminput',
'Country': CountryData,
'Contact Name': Contactnumberinput.Text,
'Comments:':commentinput.Text
}
)
;ResetForm(Form2)
How do I add onto the formula for it to also check for existing entries based on "alias" and update if there is a duplicate "alias" value?
Thank you,
I am to create an address collection form for my work team. How do I make it so that when someone on my team submits their data it will create a new entry and if it there is an existing entry, then it will update the previous entry?
I like to make it so that the work "alias" box is used a reference to determine if there is an existing entry.
Currently, my formula to create new entries is:
Patch(
'Shipping Form',
Defaults('Shipping Form'),
{
'First Name': firstnameinput.Text,
'Last Name':lastnameinput.Text,
'Alias':aliasinput.Text,
'Address Line 1':addressline1input.Text,
'Address Line 2':addressline2input.Text,
'State/Province':stateinput.Text,
'Zip/Postal Code':zipinput.Text,
'City/Region':cityinput.Text,
'Permission to share to Reporting Manger if needed?':'Perminput',
'Country': CountryData,
'Contact Name': Contactnumberinput.Text,
'Comments:':commentinput.Text
}
)
;ResetForm(Form2)
How do I add onto the formula for it to also check for existing entries based on "alias" and update if there is a duplicate "alias" value?
Thank you,
Share Improve this question edited Mar 31 at 20:40 carlosfigueira 87.4k14 gold badges136 silver badges174 bronze badges asked Mar 31 at 20:09 Wesley HWesley H 51 bronze badge New contributor Wesley H is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.1 Answer
Reset to default 0The second argument to the Patch function is the record to be updated; if you use Defaults(...), then a new record is created. So you can use something like this to update a record if it exists, or create otherwise:
With(
{
recordToUpdate:
Coalesce(
LookUp('Shipping Form', Alias = aliasinput.Text),
Defaults('Shipping Form')
)
},
Patch(
'Shipping Form',
recordToUpdate,
{
'First Name': firstnameinput.Text,
'Last Name':lastnameinput.Text,
'Alias':aliasinput.Text,
'Address Line 1':addressline1input.Text,
'Address Line 2':addressline2input.Text,
'State/Province':stateinput.Text,
'Zip/Postal Code':zipinput.Text,
'City/Region':cityinput.Text,
'Permission to share to Reporting Manger if needed?':'Perminput',
'Country': CountryData,
'Contact Name': Contactnumberinput.Text,
'Comments:':commentinput.Text
}
)
)
;ResetForm(Form2)
本文标签: How do I update a duplicate entries in PowerappsStack Overflow
版权声明:本文标题:How do I update a duplicate entries in Powerapps - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743922935a2562428.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论