web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Power Apps Edit Form
Power Apps
Unanswered

Power Apps Edit Form

(0) ShareShare
ReportReport
Posted on by 67

Hi Members,

 

I have a requirement in PowerApps: I need to save the Power Apps form details to the SharePoint list.

 

I have a SharePoint list [Product Issue Details] with columns like:

 

  1. Issue - Single line of text
  2. Issue Description - Multiple lines of text
  3. Issue Product - Lookup column from another sp list [ACGH Products]
  4. Issue Product Category - Lookup column 
  5. Issue Priority - Choice ["High", "Low", "Medium"]
  6. Issue Image - Image
  7. Issue Due Date - Date column
  8. Issue Handled By - Lookup column from another sp list [Product Employee List]
  9. Issue Raised By - Single line of text
  10. Issue Raised By Email - Single line of text
  11. Issue Status - Choice 

 

splist.jpg

 

The Power Apps form looks like:

 

formw.jpg

 

 

In Power Apps, I have added an edit form with specific columns only:

 

  1. Issue - Single line of text
  2. Issue Description - Multiple lines of text
  3. Issue Product - Lookup column from another sp list [ACGH Products]
  4. Issue Product Category - Lookup column 
  5. Issue Priority - Choice ["High", "Low", "Medium"]
  6. Issue Image - Image

Issue Product Category field will display the text based on the issue product. Now, I need to submit the form details to sharepoint list and also I need to save the other 4 field details also like:

 

 

  1. Issue Due Date field - This field date should be saved from the powerapps form only; The date should be captured from the Issue priority field; if the user selects "High" priority, the issue due date should be saved by adding 1 day, If the user selects "Medium", the issue due date will be adding 3days and for "low," 5days. So, I have tried the formula:

 

DateAdd(Today(),If(Radio2.Selected.Value=Blank(),"",If(Radio2.Selected.Value="High",1,If(Radio2.Selected.Value="Low",5,3))),TimeUnit.Days)

 

 

2. Issue Handled By = This field value should be saved from the powerapps form only, The value should save from Issue Product Category field, when this field displayed "Home," the item should save as "Henrietta Mueller", if it is "Electronics", the item should save as "Lidia Hollaway."

 

3. Issue Raised By - This field should save by current user name like:

 

 

User().FullName

 

 

4, Issue Raised By Email - This field should save by current user email like:

 

User().Email

 

 

So, for this, I have tried the Patch function with the below code, but facing an error:

 

 

Patch('Product Issue Details',Defaults('Product Issue Details'),{Issue:DataCardValue4.Text,'Issue Description':DataCardValue11.Text,'Issue Product':DataCardValue6.Selected,'Issue Product: Category':{Value:Label21.Text},'Issue Priority':Radio2.Selected,'Issue Image':Image6.Image,'Issue Raised By':User().FullName,'Issue Raised By: Employee Email':User().Email,'Issue Due Date':Text(DateAdd(Today(),If(Radio2.Selected.Value=Blank(),"",If(Radio2.Selected.Value="High",1,If(Radio2.Selected.Value="Low",5,3))),TimeUnit.Days)),'Issue Handled By':If(Label21.Text=Blank(),"",If(Label21.Text="Home","Henrietta Mueller",If(Label21.Text="Electronics","Johanna Lorenz","Henrietta Mueller")))})

 

 

Facing an 4 errors like: 

 

  1. Invalid argument type. Expecting record value but a different schema.
  2. Missing column, your formula is missing a column ID, with a type of number.
  3. This type of argument 'Issue Handled By' doesn't match the expected type record. Found type text.
  4. Network error, when using patch function, the specified column is generated from the server and cant be specified

 

apperror.jpg

 

 

Please Help me, How can I achieve this!

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,127 Most Valuable Professional on at

    Hi @Hemashree ,

    Firstly, try to parse your text as below - you will spot errors much easier. I have also included some suggestions for other pieces. Your lookup columns will cause you some grief here and you really do not need the column type with Power Apps (I never use them)

    Patch(
     'Product Issue Details',
     Defaults('Product Issue Details'),
     {
     Issue: DataCardValue4.Text,
     'Issue Description': DataCardValue11.Text,
     'Issue Product': DataCardValue6.Selected,
     'Issue Product Category': 
     {
    	 Value: Label21.Text,
    		 Id:
     LookUp(
     YourLookedUpList,
     YourLookedUpField = Label21.Text
     ).ID
     }
     'Issue Priority': Radio2.Selected,
     'Issue Image': Image6.Image,
     'Issue Raised By': User().FullName,
     'Issue Raised By Email': User().Email,
     'Issue Due Date':
     Text( 
     DateAdd( 
     Today(),
     Switch( 
     Radio2.Selected.Value,
     Blank(),
     0,
     "High",
     1,
     "Low",
     5,
     3
     )
    			),
     TimeUnit.Days
     )
     ),
     'Issue Handled By': // please put this back to text - a lookup columns
     Switch( // is way to hard to manage here
     Label21.Text,
     Blank(), 
     "",
     "Electronics",
     "Johanna Lorenz",
     "Henrietta Mueller"
     )
     }
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • HM-22080408-0 Profile Picture
    67 on at

    Thank you @WarrenBelz 

     

    Still, I am facing two errors here that is :

    1. Invalid argument type. Expecting record value but a different schema.
    2. Missing column: your formula is missing a column ID with a type of number.

     

    Please Help me, How can I achieve this

     

     

     

  • WarrenBelz Profile Picture
    153,127 Most Valuable Professional on at

    Hi @Hemashree ,

    I need to know which columns those errors are on - you will have something where the value presented does not match the column type in the List.. Also please see the note at the bottom - it will be missing the ID as you have used a lookup column and it is not really appropriate for what you are trying to do (you need to change that back to Text). I will be offline now due to time zone and will pick up your response in the morning.

  • HM-22080408-0 Profile Picture
    67 on at

    Hi @WarrenBelz 

     

    Actually, now, the code is working; there is no error in the code.

     

    Patch(
     'Product Issue Details',
     Defaults('Product Issue Details'),
     {
     Issue: DataCardValue4.Text,
     'Issue Description': DataCardValue11.Text,
     'Issue Product': DataCardValue6.Selected,
     'Issue Product: Category': {
     Value: Label21.Text,
     Id: LookUp(
     'ACGH Products',
     Title = Label21.Text
     ).ID
     },
     'Issue Priority': Radio2.Selected,
     'Issue Image': Image6.Image,
     'Issue Raised By': User().FullName,
     'Issue Raised By: Employee Email': User().Email,
     'Issue Due Date': Text(
     DateAdd(
     Today(),
     Switch(
     Radio2.Selected.Value,
     Blank(),
     0,
     "High",
     1,
     "Low",
     5,
     3
     ),
     TimeUnit.Days
     )
     ),
     'Issue Handled By': Switch(
     Label21.Text,
     Blank(),
     "",
     "Electronics",
     "Johanna Lorenz",
     "Henrietta Mueller"
     )
     }
    )

     

     

    But, while submitting the data, I am facing an error like this:

     

    1. Network error, when using patch function, the specified column is generated from the server and cant be specified

     

     

    error76.jpg

     

     

     

     

     

    1.  

     

     

     

    Please Help me!

  • WarrenBelz Profile Picture
    153,127 Most Valuable Professional on at

    @Hemashree ,

    I suspect 'Issue Product: Category' - you cannot patch to this if it is a "secondary" lookup column (you actually do not need to). You are the only one who can see your data, so if that one is not the issue, start patching one column, then keep adding until it breaks.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard