Hello,
I am trying without success to save data from my app to a Sharepoint list called tblDysf containing columns : dysEmpEmail, dysAffaireNum, dysNature, dysClassification, dysDescription, dysMesure, dysAction
Below is my EditScreen1
Data in "Affaire N°" comes from a table called tblAffaire
Data in "Nature" comes from a table called tblNature
Data in "Classification" comes from a table called tblClass
When pressing validate :
1 - i tried :
SubmitForm(EditForm1) but instead of saving data from the three dropdowns to my SP List it save 50 in the corresponding columns
2 - Then i tried :
Patch(tblDysf; Defaults(tblDysf); {dysEmpEmail:txtEmail.Text; dysAffaireNum:cboAffaireNum.Selected; dysNature: ""; dysClassification: ""; dysDescription:txtDescription.Text; dysMesure:txtMesure.Text; dysAction:txtAction.Text})
but i have an error message saying that dysAffaireNum is waiting for a Type text data and cboAffaireNum.Selected is of Record type.
I can't find a way out
Thanks for your help
Solved! Go to Solution.
I made it work with the following code
Patch(
tblDysf;
Defaults(tblDysf);
{
dysEmpEmail: txtEmail.Text;
dysAffaireNum: cboAffaireNum.SelectedText.Value;
dysNature: cboNature.SelectedText.Value;
dysClassification:ddClassification.SelectedText.Value;
dysDescription: txtDescription.Text;
dysMesure: txtMesure.Text;
dysAction: txtAction.Text
}
)
thanks for your help
Hi @Anonymous ,
Change the line to this
dysAffaireNum:Value(cboAffaireNum.Selected.xxxx);
where xxxx is the valid output of the combo box (Value / Result / Field Name)
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.
Hello, you can try :
- change the date type of column "dysAffaireNum " in your sharepoint list to "Number"
or
- change "cboAffaireNum.Selected" to "cboAffaireNum.Selected.Value (or result)" or Text(cboAffaireNum.Selected) in your onselected property of "Validate" button
Hello WarenBelz and thanks for your reply.
I changed to
dysAffaireNum:Value(cboAffaireNum.Selected.FieldName)
with FieldName been the field from tblAffaire which gave
dysAffaireNum:Value(cboAffaireNum.Selected.affnum)
i don't have error messages in the power app formula any more however the data entered in power app is not saved in the Sharepoint List see below (ID=8) in yellow it says that the field is required.
Thanks
@Anonymous ,
Can you please confirm that the three fields are numeric - if so
Patch(
tblDysf;
Defaults(tblDysf);
{
dysEmpEmail:txtEmail.Text;
dysAffaireNum:Value(cboAffaireNum.Selected.affnum);
dysNature:0;
dysClassification:0;
dysDescription:txtDescription.Text;
dysMesure:txtMesure.Text;
dysAction:txtAction.Text
)
)
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.
@Anonymous ,
Then the problem you have is that they seem to be required fields but you are patching a blank string "" into them. You need to either remove the compulsory requirement or put in a value. Also disregard the Value() function as it is not needed.
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.
I made it work with the following code
Patch(
tblDysf;
Defaults(tblDysf);
{
dysEmpEmail: txtEmail.Text;
dysAffaireNum: cboAffaireNum.SelectedText.Value;
dysNature: cboNature.SelectedText.Value;
dysClassification:ddClassification.SelectedText.Value;
dysDescription: txtDescription.Text;
dysMesure: txtMesure.Text;
dysAction: txtAction.Text
}
)
thanks for your help
@Anonymous ,
That is pretty much what I said - except you need to use Selected rather than SelectedText which is deprecated
Patch(
tblDysf;
Defaults(tblDysf);
{
dysEmpEmail: txtEmail.Text;
dysAffaireNum: cboAffaireNum.Selected.Value;
dysNature: cboNature.Selected.Value;
dysClassification:ddClassification.Selected.Value;
dysDescription: txtDescription.Text;
dysMesure: txtMesure.Text;
dysAction: txtAction.Text
}
)
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.
User | Count |
---|---|
253 | |
106 | |
94 | |
50 | |
39 |