cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Shang
Frequent Visitor

Can the patch function send data of two forms(view form and edit form) ?

Can the patch function send data of two forms(view form and edit form) ?

There is a dinner order list
I want to patch data after clicking the submit button,
but the result of SharePoint is empty.
.
There are two empty data of columns:
(1)count-column(data type:number):
DataCardValue23.Selected.Value
(2)rice-column(data-type:text):
DataCardValue24.Selected.Value

The function of submit button is:
Patch(
晚餐訂購,
Defaults(晚餐訂購),
{
訂購者姓名: User().FullName,
中文菜名: DataCardValue11.Text,
英文菜名: DataCardValue12.Text,
飯量: DataCardValue24.SelectedText.Value,
數量: DataCardValue23.Selected.Value,
單價: Value(DataCardValue13.Text)
}
)

 

Please help me to solve the problem,thanks.

 

Shang_0-1618565680941.pngShang_1-1618565688541.png

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
timl
Super User III
Super User III

Hi @Shang 

In this scenario, I would attempt to do this by referring to the Updates property of the edit form that contains DataCardValue23 and DataCardValue24. Assuming that the edit form that contains these two controls is called EditForm1, this is the syntax that you would use.

 

Patch(
      晚餐訂購,
      Defaults(晚餐訂購),
      {
        訂購者姓名: User().FullName,
        中文菜名: DataCardValue11.Text,
        英文菜名: DataCardValue12.Text,
        單價: Value(DataCardValue13.Text)
      },
      EditForm1.Updates
)

 

 

View solution in original post

timl
Super User III
Super User III

Hi @Shang 

The cause of this problem is most likely the Item property of the view form. You'll need to set this so that it references the record that you want to show in the form.

 

View solution in original post

3 REPLIES 3
timl
Super User III
Super User III

Hi @Shang 

In this scenario, I would attempt to do this by referring to the Updates property of the edit form that contains DataCardValue23 and DataCardValue24. Assuming that the edit form that contains these two controls is called EditForm1, this is the syntax that you would use.

 

Patch(
      晚餐訂購,
      Defaults(晚餐訂購),
      {
        訂購者姓名: User().FullName,
        中文菜名: DataCardValue11.Text,
        英文菜名: DataCardValue12.Text,
        單價: Value(DataCardValue13.Text)
      },
      EditForm1.Updates
)

 

 

View solution in original post

Shang
Frequent Visitor

Hi timl,

thanks for your suggestion,

it works!

But I find a new problem,

in the app screen and preview mode,

the edit form  appears "No Data".

The datasource of the edit form is set as the same as the view form.

I don't know whether the reason is about datasource.

Shang_0-1618903234363.png

 

timl
Super User III
Super User III

Hi @Shang 

The cause of this problem is most likely the Item property of the view form. You'll need to set this so that it references the record that you want to show in the form.

 

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (76,965)